dload: dont forget to initialize open_mode
That's a funny one, building with optimization levels (with both gcc and clang) caused open_mode to always be set to "ab", which worked. This was spotted both with clang-analyzer, and by Jakob who reported a segfault as he was using an un-optimized build. Signed-off-by: Xavier Chantry <chantry.xavier@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
0e03c0849d
commit
a461837835
1 changed files with 2 additions and 1 deletions
|
@ -159,7 +159,8 @@ static int curl_download_internal(const char *url, const char *localpath,
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
FILE *localf = NULL;
|
FILE *localf = NULL;
|
||||||
const char *open_mode, *useragent;
|
const char *useragent;
|
||||||
|
const char *open_mode = "wb";
|
||||||
char *destfile, *tempfile;
|
char *destfile, *tempfile;
|
||||||
char hostname[256]; /* RFC1123 states applications should support this length */
|
char hostname[256]; /* RFC1123 states applications should support this length */
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|
Loading…
Add table
Reference in a new issue