commit | 229738ce4e5432023024d15b74541222228eb7b3 | [log] [tgz] |
---|---|---|
author | Mike Frysinger <vapier@gentoo.org> | Wed Oct 07 20:41:56 2009 -0400 |
committer | Dmitry V. Levin <ldv@altlinux.org> | Thu Oct 08 14:08:57 2009 +0000 |
tree | af8355a36af6556a1f78615fee19182e19f89939 | |
parent | 8bfc23e056cdfc3a8f4eed426db706dd63234c88 [diff] |
Avoid malloc(0) in getdents parsers On end of directory, getdents returns 0. This return value is used to then try and do malloc(0), but on some systems this will always return NULL. Since the code won't read the pointer in question if len is 0, then don't bother calling malloc(0) and set the pointer to NULL ourself. * file.c (sys_getdents, sys_getdents64): Avoid malloc(0) call. Signed-off-by: Mike Frysinger <vapier@gentoo.org>