Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: msnyder@sonic.net
To: gdb-patches@sourceware.org
Subject: [patch] expprint.c, check strchr return val for null.
Date: Wed, 29 Aug 2007 22:10:00 -0000	[thread overview]
Message-ID: <17390.12.7.175.2.1188425405.squirrel@webmail.sonic.net> (raw)

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



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

2007-08-29  Michael Snyder  <msnyder@access-company.com>

	* expprint.c (print_subexp_standard): Check strchr for null.

Index: expprint.c
===================================================================
RCS file: /cvs/src/src/gdb/expprint.c,v
retrieving revision 1.29
diff -p -r1.29 expprint.c
*** expprint.c	23 Aug 2007 18:08:30 -0000	1.29
--- expprint.c	29 Aug 2007 22:08:22 -0000
***************
*** 30,35 ****
--- 30,36 ----
  #include "gdb_string.h"
  #include "block.h"
  #include "objfiles.h"
+ #include "gdb_assert.h"
  
  #ifdef HAVE_CTYPE_H
  #include <ctype.h>
*************** print_subexp_standard (struct expression
*** 212,217 ****
--- 213,219 ----
  	    for (tem = 0; tem < nargs; tem++)
  	      {
  		nextS = strchr (s, ':');
+ 		gdb_assert (nextS);	/* Make sure we found ':'.  */
  		*nextS = '\0';
  		fprintf_unfiltered (stream, " %s: ", s);
  		s = nextS + 1;

             reply	other threads:[~2007-08-29 22:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-29 22:10 msnyder [this message]
2007-09-04 14:30 ` Joel Brobecker
2007-09-05  0:13   ` msnyder

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=17390.12.7.175.2.1188425405.squirrel@webmail.sonic.net \
    --to=msnyder@sonic.net \
    --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