This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

getsysstats problem



Hi,

I got the following warning - and a segfault in getsysstats running
the testsuite:
../sysdeps/unix/sysv/linux/getsysstats.c:48: warning: `result' might be used uninitialized in this function

We do need to initialize result with NULL.  I've committed the
appended patch.

Andreas

2000-07-06  Andreas Jaeger  <aj@suse.de>

	* sysdeps/unix/sysv/linux/getsysstats.c (get_proc_path):
	Initialize result.

============================================================
Index: sysdeps/unix/sysv/linux/getsysstats.c
--- sysdeps/unix/sysv/linux/getsysstats.c	2000/07/06 00:43:06	1.10
+++ sysdeps/unix/sysv/linux/getsysstats.c	2000/07/06 09:23:55
@@ -45,7 +45,7 @@
 {
   struct mntent mount_point;
   struct mntent *entry;
-  char *result;
+  char *result = NULL;
   char *copy_result;
   FILE *fp;
 

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]