This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[rfa] remote-fileio.c, remote_fileio_func_fstat, uninitialized st.st_ino.


Hi Corinna,

Coverity points out that st.st_ino is un-initialized when it is passed to remote_fileio_to_fio_stat, which uses it. I have no idea if
initializing it to zero is the right thing to do. Can you comment?


Thanks,
Michael

2011-03-02  Michael Snyder  <msnyder@vmware.com>

	* remote-fileio.c (remote_fileio_func_fstat): Initialize st_ino
	to zero.

Index: remote-fileio.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-fileio.c,v
retrieving revision 1.40
diff -u -p -u -p -r1.40 remote-fileio.c
--- remote-fileio.c	25 Jan 2011 11:54:00 -0000	1.40
+++ remote-fileio.c	2 Mar 2011 21:41:48 -0000
@@ -1175,6 +1175,7 @@ remote_fileio_func_fstat (char *buf)
       remote_fileio_to_fio_uint (1, fst.fst_dev);
       st.st_mode = S_IFCHR | (fd == FIO_FD_CONSOLE_IN ? S_IRUSR : S_IWUSR);
       st.st_nlink = 1;
+      st.st_ino = 0;
 #ifdef HAVE_GETUID
       st.st_uid = getuid ();
 #else

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