From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27825 invoked by alias); 24 Jul 2007 20:21:35 -0000 Received: (qmail 27809 invoked by uid 22791); 24 Jul 2007 20:21:35 -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; Tue, 24 Jul 2007 20:21:33 +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 l6OKLTOl016915; Tue, 24 Jul 2007 13:21:29 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Tue, 24 Jul 2007 13:21:29 -0700 (PDT) Message-ID: <8742.12.7.175.2.1185308489.squirrel@webmail.sonic.net> Date: Tue, 24 Jul 2007 20:31:00 -0000 Subject: [PATCH] ax-gdb, null ptr guard From: msnyder@sonic.net To: gdb-patches@sourceware.org Cc: jimb@codesourcery.com User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070724132129_84240" 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-07/txt/msg00258.txt.bz2 ------=_20070724132129_84240 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 13 Coverity... ------=_20070724132129_84240 Content-Type: text/plain; name="thisname.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="thisname.txt" Content-length: 1175 2007-07-24 Michael Snyder * ax-gdb.c (find_field): Guard against null ptr. Index: ax-gdb.c =================================================================== RCS file: /cvs/src/src/gdb/ax-gdb.c,v retrieving revision 1.34 diff -p -r1.34 ax-gdb.c *** ax-gdb.c 13 Jun 2007 17:11:09 -0000 1.34 --- ax-gdb.c 24 Jul 2007 20:18:36 -0000 *************** find_field (struct type *type, char *nam *** 1172,1183 **** { char *this_name = TYPE_FIELD_NAME (type, i); ! if (this_name && strcmp (name, this_name) == 0) ! return i; ! if (this_name[0] == '\0') ! internal_error (__FILE__, __LINE__, ! _("find_field: anonymous unions not supported")); } error (_("Couldn't find member named `%s' in struct/union `%s'"), --- 1172,1186 ---- { char *this_name = TYPE_FIELD_NAME (type, i); ! if (this_name) ! { ! if (strcmp (name, this_name) == 0) ! return i; ! if (this_name[0] == '\0') ! internal_error (__FILE__, __LINE__, ! _("find_field: anonymous unions not supported")); ! } } error (_("Couldn't find member named `%s' in struct/union `%s'"), ------=_20070724132129_84240--