Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sterling Augustine <saugustine@google.com>
To: gdb-patches@sourceware.org
Subject: Initialize status in gdbserver/linux-low.c
Date: Mon, 16 Jul 2012 15:55:00 -0000	[thread overview]
Message-ID: <CAEG7qUx0-9haWev6_9R37jgeWd6UsSnxtU58FbexF+Uz6PsfJQ@mail.gmail.com> (raw)

[-- 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);
 

             reply	other threads:[~2012-07-16 15:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-16 15:55 Sterling Augustine [this message]
2012-07-16 16:06 ` Pedro Alves
2012-07-16 17:09   ` Sterling Augustine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAEG7qUx0-9haWev6_9R37jgeWd6UsSnxtU58FbexF+Uz6PsfJQ@mail.gmail.com \
    --to=saugustine@google.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox