This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[rfa] remote-fileio.c, remote_fileio_func_fstat, uninitialized st.st_ino.
- From: Michael Snyder <msnyder at vmware dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: vinschen at redhat dot com
- Date: Wed, 02 Mar 2011 13:48:58 -0800
- Subject: [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