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:
63beea4
)
uclient-utils: Handle memory allocation failure for url file name
author
Tobias Schramm
<tobleminer@gmail.com>
Tue, 20 Feb 2018 10:26:31 +0000
(11:26 +0100)
committer
Felix Fietkau
<nbd@nbd.name>
Thu, 22 Feb 2018 16:52:04 +0000
(17:52 +0100)
Add null pointer check to allocation of url filename
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
uclient-utils.c
patch
|
blob
|
history
diff --git
a/uclient-utils.c
b/uclient-utils.c
index a375eeacb33eceb0925d947da156f3e722d5f94d..3eaf2d5febe2f38bebdd4921f0c4a449a41f5537 100644
(file)
--- a/
uclient-utils.c
+++ b/
uclient-utils.c
@@
-178,7
+178,7
@@
char *uclient_get_url_filename(const char *url, const char *default_name)
len -= str - url;
if (len > 0)
- return strn
cpy(calloc(1, len + 1),
str, len);
+ return strn
dup(
str, len);
return strdup(default_name);
}