Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: msnyder@sonic.net
To: gdb-patches@sourceware.org
Subject: [patch] stabsread, guard against null.
Date: Wed, 29 Aug 2007 21:20:00 -0000	[thread overview]
Message-ID: <5244.12.7.175.2.1188422413.squirrel@webmail.sonic.net> (raw)

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

If strchr returns null, we're going to crash.


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

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

	* stabsread.c (patch_block_status): Guard against null.

Index: stabsread.c
===================================================================
RCS file: /cvs/src/src/gdb/stabsread.c,v
retrieving revision 1.97
diff -p -r1.97 stabsread.c
*** stabsread.c	23 Aug 2007 18:08:38 -0000	1.97
--- stabsread.c	29 Aug 2007 21:18:10 -0000
***************
*** 45,50 ****
--- 45,51 ----
  #include "doublest.h"
  #include "cp-abi.h"
  #include "cp-support.h"
+ #include "gdb_assert.h"
  
  #include <ctype.h>
  
*************** patch_block_stabs (struct pending *symbo
*** 359,364 ****
--- 360,366 ----
  	{
  	  name = stabs->stab[ii];
  	  pp = (char *) strchr (name, ':');
+ 	  gdb_assert (pp);	/* Must find a ':' or game's over.  */
  	  while (pp[1] == ':')
  	    {
  	      pp += 2;

             reply	other threads:[~2007-08-29 21:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-29 21:20 msnyder [this message]
2007-09-04 14:01 ` Joel Brobecker
2007-09-05  0:01   ` 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=5244.12.7.175.2.1188422413.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