aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Mike Frysinger <vapier@gentoo.org>2007-01-28 06:27:47 +0000
committerGravatar Mike Frysinger <vapier@gentoo.org>2007-01-28 06:27:47 +0000
commitfd67ab2823204db43b6bae0f448e12844a133771 (patch)
treeb5c28947268425899a3f1a05b5b40ebbb04c15f1
parent69b4382f84fe4bef88c41818d0cc19bf322de324 (diff)
downloaduClibc-fd67ab2823204db43b6bae0f448e12844a133771.tar.gz
uClibc-fd67ab2823204db43b6bae0f448e12844a133771.tar.bz2
make sure we clear out the buffer so that random garbage on the stack doesnt screw us up
-rw-r--r--libc/sysdeps/linux/common/xstatconv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/xstatconv.c b/libc/sysdeps/linux/common/xstatconv.c
index df6ebaa2b..e0f18d16b 100644
--- a/libc/sysdeps/linux/common/xstatconv.c
+++ b/libc/sysdeps/linux/common/xstatconv.c
@@ -30,11 +30,13 @@
# undef __USE_FILE_OFFSET64
#endif
#include <sys/stat.h>
+#include <string.h>
#include "xstatconv.h"
void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
{
/* Convert to current kernel version of `struct stat'. */
+ memset(buf, 0x00, sizeof(*buf));
buf->st_dev = kbuf->st_dev;
buf->st_ino = kbuf->st_ino;
buf->st_mode = kbuf->st_mode;
@@ -60,6 +62,7 @@ void __xstat_conv(struct kernel_stat *kbuf, struct stat *buf)
void __xstat64_conv(struct kernel_stat64 *kbuf, struct stat64 *buf)
{
/* Convert to current kernel version of `struct stat64'. */
+ memset(buf, 0x00, sizeof(*buf));
buf->st_dev = kbuf->st_dev;
buf->st_ino = kbuf->st_ino;
#ifdef _HAVE_STAT64___ST_INO