uclient-fetch: fix overloading of output_file variable
authorFelix Fietkau <nbd@nbd.name>
Thu, 2 Nov 2017 20:58:42 +0000 (21:58 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 2 Nov 2017 20:59:15 +0000 (21:59 +0100)
commit4b87d83160fec70d50b7fcd736a8c538c28a016c
tree75d2ffb6327124c6f9e56b5bf4f1fae7306964bf
parent24d6eded73dec427fc4a3a20cc73c94227f59c31
uclient-fetch: fix overloading of output_file variable

When uclient-fetch is called with multiple URL's, it derives the
first filename from the URL. It then sets the global output_file
variable, causing a use-after-free bug on an attempt to use it as output
file for the next file.

Fix this by avoiding the overwrite entirely by only setting a local
variable

Reported-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
uclient-fetch.c