Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: msnyder@sonic.net
To: gdb-patches@sourceware.org
Subject: [patch] gnu-v2-abi.c: strchr may return null
Date: Wed, 29 Aug 2007 21:26:00 -0000	[thread overview]
Message-ID: <16934.12.7.175.2.1188422744.squirrel@webmail.sonic.net> (raw)

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



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

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

	* gnu-v2-abi.c (gnuv2_value_rtti_type): Guard against null.

Index: gnu-v2-abi.c
===================================================================
RCS file: /cvs/src/src/gdb/gnu-v2-abi.c,v
retrieving revision 1.25
diff -p -r1.25 gnu-v2-abi.c
*** gnu-v2-abi.c	23 Aug 2007 18:08:33 -0000	1.25
--- gnu-v2-abi.c	29 Aug 2007 21:24:09 -0000
*************** gnuv2_value_rtti_type (struct value *v, 
*** 192,198 ****
    CORE_ADDR vtbl;
    struct minimal_symbol *minsym;
    struct symbol *sym;
!   char *demangled_name;
    struct type *btype;
  
    if (full)
--- 192,198 ----
    CORE_ADDR vtbl;
    struct minimal_symbol *minsym;
    struct symbol *sym;
!   char *demangled_name, *p;
    struct type *btype;
  
    if (full)
*************** gnuv2_value_rtti_type (struct value *v, 
*** 252,258 ****
  
    /* If we just skip the prefix, we get screwed by namespaces */
    demangled_name=cplus_demangle(demangled_name,DMGL_PARAMS|DMGL_ANSI);
!   *(strchr(demangled_name,' '))=0;
  
    /* Lookup the type for the name */
    /* FIXME: chastain/2003-11-26: block=NULL is bogus.  See pr gdb/1465. */
--- 252,260 ----
  
    /* If we just skip the prefix, we get screwed by namespaces */
    demangled_name=cplus_demangle(demangled_name,DMGL_PARAMS|DMGL_ANSI);
!   p = strchr (demangled_name, ' ');
!   if (p)
!     *p = '\0';
  
    /* Lookup the type for the name */
    /* FIXME: chastain/2003-11-26: block=NULL is bogus.  See pr gdb/1465. */

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

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