From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10306 invoked by alias); 29 Aug 2007 21:20:27 -0000 Received: (qmail 10295 invoked by uid 22791); 29 Aug 2007 21:20:25 -0000 X-Spam-Check-By: sourceware.org Received: from a.mail.sonic.net (HELO a.mail.sonic.net) (64.142.16.245) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 29 Aug 2007 21:20:15 +0000 Received: from webmail.sonic.net (b.webmail.sonic.net [64.142.100.148]) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id l7TLKDBw012325 for ; Wed, 29 Aug 2007 14:20:13 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Wed, 29 Aug 2007 14:20:13 -0700 (PDT) Message-ID: <5244.12.7.175.2.1188422413.squirrel@webmail.sonic.net> Date: Wed, 29 Aug 2007 21:20:00 -0000 Subject: [patch] stabsread, guard against 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="----=_20070829142013_82598" 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/msg00529.txt.bz2 ------=_20070829142013_82598 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 47 If strchr returns null, we're going to crash. ------=_20070829142013_82598 Content-Type: text/plain; name="113.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="113.txt" Content-length: 835 2007-08-29 Michael Snyder * 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 *************** 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; ------=_20070829142013_82598--