projects
/
project
/
uclient.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f2573da
)
uclient-fetch: Check for nullpointer returned by uclient_get_url_filename
author
Tobias Schramm
<tobleminer@gmail.com>
Sun, 18 Feb 2018 12:46:04 +0000
(13:46 +0100)
committer
John Crispin
<john@phrozen.org>
Tue, 20 Feb 2018 07:16:16 +0000
(08:16 +0100)
uclient_get_url_filename may return a null ptr resulting in a null
ptr dereference by fprintf and open
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
uclient-fetch.c
patch
|
blob
|
history
diff --git
a/uclient-fetch.c
b/uclient-fetch.c
index 6961d94b12408203bc6ce6bb35d5700082dd9717..38c9c53e35c7f20c4f36d059f5f25673a4e81176 100644
(file)
--- a/
uclient-fetch.c
+++ b/
uclient-fetch.c
@@
-122,6
+122,11
@@
static int open_output_file(const char *path, uint64_t resume_offset)
}
} else {
filename = uclient_get_url_filename(path, "index.html");
+ if (!filename) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
output_file = filename;
}
@@
-151,6
+156,7
@@
done:
free:
free(filename);
+out:
return ret;
}