From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13832 invoked by alias); 29 Aug 2007 21:26:00 -0000 Received: (qmail 13817 invoked by uid 22791); 29 Aug 2007 21:26:00 -0000 X-Spam-Check-By: sourceware.org Received: from b.mail.sonic.net (HELO b.mail.sonic.net) (64.142.19.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 29 Aug 2007 21:25:47 +0000 Received: from webmail.sonic.net (b.webmail.sonic.net [64.142.100.148]) by b.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id l7TLPiUc021601 for ; Wed, 29 Aug 2007 14:25:44 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Wed, 29 Aug 2007 14:25:44 -0700 (PDT) Message-ID: <16934.12.7.175.2.1188422744.squirrel@webmail.sonic.net> Date: Wed, 29 Aug 2007 21:26:00 -0000 Subject: [patch] gnu-v2-abi.c: strchr may return null From: msnyder@sonic.net To: gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070829142544_79390" Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00530.txt.bz2 ------=_20070829142544_79390 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 0 ------=_20070829142544_79390 Content-Type: text/plain; name="112.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="112.txt" Content-length: 1500 2007-08-29 Michael Snyder * 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. */ ------=_20070829142544_79390--