diff options
author | Jim Meyering <jim@meyering.net> | 1997-11-30 10:24:41 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1997-11-30 10:24:41 +0000 |
commit | dcd4c05dfaeac27ea1ae101ccc3f47a9483a0fc5 (patch) | |
tree | 549cd9c5102e2b27ab252bef8947516339e1a8ea /lib | |
parent | 07783bcdf0fd2f0dc5b4e2707db58e0a62b7e1b6 (diff) | |
download | coreutils-dcd4c05dfaeac27ea1ae101ccc3f47a9483a0fc5.tar.xz |
(savedir): Check for size zero before invoking
malloc; this can occur if st_size arg overflows on conversion to
unsigned int. All callers now cast st_size arg to unsigned int.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/savedir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/savedir.c b/lib/savedir.c index 76634eef4..4c07bffc2 100644 --- 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); |