From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH] Fix PR remote/15974
Date: Sat, 30 Nov 2013 05:47:00 -0000 [thread overview]
Message-ID: <1385782688-375-1-git-send-email-yao@codesourcery.com> (raw)
In remote-notif.c:handle_notification, we have a loop,
for (i = 0; i < ARRAY_SIZE (notifs); i++)
{
nc = notifs[i];
if (strncmp (buf, nc->name, strlen (nc->name)) == 0
&& buf[strlen (nc->name)] == ':')
break;
}
/* We ignore notifications we don't recognize, for compatibility
with newer stubs. */
if (nc == NULL)
return;
If the notification is not in the list 'notifs', the last entry is
used, which is wrong. It should be NULL. This patch sets 'nc' to
NULL in the loop.
gdb:
2013-11-30 Yao Qi <yao@codesourcery.com>
PR remote/15974
* remote-notif.c (handle_notification): Set variable 'nc' to
NULL in loop.
---
gdb/remote-notif.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gdb/remote-notif.c b/gdb/remote-notif.c
index 0d59279..598e888 100644
--- a/gdb/remote-notif.c
+++ b/gdb/remote-notif.c
@@ -136,6 +136,7 @@ handle_notification (struct remote_notif_state *state, char *buf)
if (strncmp (buf, nc->name, strlen (nc->name)) == 0
&& buf[strlen (nc->name)] == ':')
break;
+ nc = NULL;
}
/* We ignore notifications we don't recognize, for compatibility
--
1.7.7.6
next reply other threads:[~2013-11-30 3:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-30 5:47 Yao Qi [this message]
2013-11-30 10:11 ` Pedro Alves
2013-12-02 6:41 ` Yao Qi
2013-12-02 10:02 ` Pedro Alves
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=1385782688-375-1-git-send-email-yao@codesourcery.com \
--to=yao@codesourcery.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