projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07783bc
)
(savedir): Check for size zero before invoking
author
Jim Meyering
<jim@meyering.net>
Sun, 30 Nov 1997 10:24:41 +0000
(10:24 +0000)
committer
Jim Meyering
<jim@meyering.net>
Sun, 30 Nov 1997 10:24:41 +0000
(10:24 +0000)
malloc; this can occur if st_size arg overflows on conversion to
unsigned int. All callers now cast st_size arg to unsigned int.
lib/savedir.c
patch
|
blob
|
history
diff --git
a/lib/savedir.c
b/lib/savedir.c
index 76634eef4e62d203b25e329ecf922d7b9d3e850b..4c07bffc294b378eeeab952a79f30e669daf0fb3 100644
(file)
--- a/
lib/savedir.c
+++ b/
lib/savedir.c
@@
-87,7
+87,7
@@
savedir (dir, name_size)
if (dirp == NULL)
return NULL;
- name_space = (char *) malloc (name_size);
+ name_space = (char *) malloc (name_size
? name_size : 1
);
if (name_space == NULL)
{
closedir (dirp);