Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Initialize status in gdbserver/linux-low.c
@ 2012-07-16 15:55 Sterling Augustine
  2012-07-16 16:06 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Sterling Augustine @ 2012-07-16 15:55 UTC (permalink / raw)
  To: gdb-patches

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

Hi,

As the code for handle_extended_wait exists today, status can be used
uninitialized on line 486 if pull_pid_from_list on line 451 returns
true.

This near-trivial patch initializes it to zero at the declaration.

OK for mainline?

Sterling


2012-07-07  Sterling Augustine  <saugustine@google.com>

	* gdbserver/linux-low.c (handle_extended_wait): Initialize status.

[-- Attachment #2: patch --]
[-- Type: application/octet-stream, Size: 492 bytes --]

Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.226
diff -d -u -r1.226 linux-low.c
--- linux-low.c	7 Jul 2012 12:13:57 -0000	1.226
+++ linux-low.c	16 Jul 2012 15:50:12 -0000
@@ -443,7 +443,7 @@
     {
       ptid_t ptid;
       unsigned long new_pid;
-      int ret, status;
+      int ret, status = 0;
 
       ptrace (PTRACE_GETEVENTMSG, lwpid_of (event_child), 0, &new_pid);
 

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

end of thread, other threads:[~2012-07-16 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-16 15:55 Initialize status in gdbserver/linux-low.c Sterling Augustine
2012-07-16 16:06 ` Pedro Alves
2012-07-16 17:09   ` Sterling Augustine

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