From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5661 invoked by alias); 29 Aug 2007 22:10:13 -0000 Received: (qmail 5649 invoked by uid 22791); 29 Aug 2007 22:10:12 -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 22:10:07 +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 l7TMA55f002420 for ; Wed, 29 Aug 2007 15:10:05 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Wed, 29 Aug 2007 15:10:05 -0700 (PDT) Message-ID: <17390.12.7.175.2.1188425405.squirrel@webmail.sonic.net> Date: Wed, 29 Aug 2007 22:10:00 -0000 Subject: [patch] expprint.c, check strchr return val for 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="----=_20070829151005_44636" 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/msg00534.txt.bz2 ------=_20070829151005_44636 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 1 ------=_20070829151005_44636 Content-Type: text/plain; name="110.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="110.txt" Content-length: 885 2007-08-29 Michael Snyder * 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 *************** 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; ------=_20070829151005_44636--