Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfa] remote-fileio.c, remote_fileio_func_fstat, uninitialized st.st_ino.
@ 2011-03-02 21:49 Michael Snyder
  2011-03-03  4:37 ` Joel Brobecker
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Snyder @ 2011-03-02 21:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: vinschen

[-- Attachment #1: Type: text/plain, Size: 236 bytes --]

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


[-- Attachment #2: fileio.txt --]
[-- Type: text/plain, Size: 715 bytes --]

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-03-03 18:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-02 21:49 [rfa] remote-fileio.c, remote_fileio_func_fstat, uninitialized st.st_ino Michael Snyder
2011-03-03  4:37 ` Joel Brobecker
2011-03-03  8:29   ` Corinna Vinschen
2011-03-03  9:25     ` Joel Brobecker
2011-03-03 10:04       ` Pedro Alves
2011-03-03 10:51         ` Corinna Vinschen
2011-03-03 17:22           ` Michael Snyder
2011-03-03 17:35             ` Corinna Vinschen
2011-03-03 18:36               ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox