wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

wget2 | Fixed data corruption bugs in transfer encoding chunked code (!4


From: Michael Roosz
Subject: wget2 | Fixed data corruption bugs in transfer encoding chunked code (!480)
Date: Thu, 24 Dec 2020 10:01:51 +0000


Michael Roosz created a merge request: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/480

Project:Branches: michaelroosz/wget2:fix-transfer-encoding-chunked to 
gnuwget/wget2:master
Author:    Michael Roosz



This PR fixes two data corruption bugs in the Transfer-Encoding chunked code, 
as well as two more crash bugs in the wget_http_get_response_cb() function.

Background:
After switching from Apache2 to nginx + haproxy on my servers, I started to see 
a lot of incomplete file downloads and logs like these:
> Failed to read 0 bytes (17)
> Failed to read 0 bytes (22)
> Failed to uncompress gzip stream (-3)

After hours of debugging I was finally able to trace it back to the code inside 
wget_http_get_response_cb().
The two main bugs are:
- `wget_tcp_read()` was called with a buffer length of 0 when the buffer was 
full and the code never resized the buffer (causing the "Failed to read 0 
bytes" errors)
- Sometimes the data passed to `wget_decompress()` was corrupted, causing the 
"Failed to uncompress gzip stream (-3)"

In addition I found and fixed to crash bugs in the generic code of 
wget_http_get_response_cb().

### Approver's checklist:

* [ ] The author has submitted the FSF Copyright Assignment and is listed in 
AUTHORS
* [ ] There is a test suite reasonably covering new functionality or 
modifications
* [ ] Function naming, parameters, return values, types, etc., are consistent 
with existing code
* [ ] This feature/change has adequate documentation added (if appropriate)
* [ ] No obvious mistakes / misspelling in the code

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/-/merge_requests/480
You're receiving this email because of your account on gitlab.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]