Bug 13351 - wget with a redirection truncates the file to 0 bytes when it receives an empty response from the server
Summary: wget with a redirection truncates the file to 0 bytes when it receives an emp...
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.32.x
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-02 22:19 UTC by Héctor Molinero Fernández
Modified: 2020-12-08 18:07 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Sample script that replicates the issue (223 bytes, text/plain)
2020-12-02 22:19 UTC, Héctor Molinero Fernández
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Héctor Molinero Fernández 2020-12-02 22:19:43 UTC
Created attachment 8691 [details]
Sample script that replicates the issue

When wget is invoked with a stdout redirection to a file and receives an empty response from the server the destination file is truncated to 0 bytes. This is caused by ftruncate being called with length 0.
Comment 1 Denys Vlasenko 2020-12-08 18:07:11 UTC
Fixed in git.