From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14736 invoked by alias); 11 Aug 2007 20:31:14 -0000 Received: (qmail 14540 invoked by uid 22791); 11 Aug 2007 20:31:13 -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; Sat, 11 Aug 2007 20:31:11 +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 l7BKV3h9025069; Sat, 11 Aug 2007 13:31:03 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Sat, 11 Aug 2007 13:31:03 -0700 (PDT) Message-ID: <25376.12.7.175.2.1186864263.squirrel@webmail.sonic.net> In-Reply-To: <8146.12.7.175.2.1186864158.squirrel@webmail.sonic.net> References: <8146.12.7.175.2.1186864158.squirrel@webmail.sonic.net> Date: Sat, 11 Aug 2007 20:31:00 -0000 Subject: Re: [PATCH] ada-lang.c, null pointer From: msnyder@sonic.net To: msnyder@sonic.net Cc: gdb-patches@sourceware.org, brobecker@adacore.com User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070811133103_53843" 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/msg00245.txt.bz2 ------=_20070811133103_53843 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 139 > According to the first line of the function, name may be null. > In which case, we'll crash on the next line. Err, here's the patch... ------=_20070811133103_53843 Content-Type: text/plain; name="55.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="55.txt" Content-length: 812 2007-08-11 Michael Snyder * ada-lang.c (field_alignment): Guard against NULL. Index: ada-lang.c =================================================================== RCS file: /cvs/src/src/gdb/ada-lang.c,v retrieving revision 1.100 diff -p -r1.100 ada-lang.c *** ada-lang.c 6 Aug 2007 20:07:44 -0000 1.100 --- ada-lang.c 11 Aug 2007 20:25:00 -0000 *************** field_alignment (struct type *type, int *** 6119,6125 **** int len = (name == NULL) ? 0 : strlen (name); int align_offset; ! if (!isdigit (name[len - 1])) return 1; if (isdigit (name[len - 2])) --- 6119,6125 ---- int len = (name == NULL) ? 0 : strlen (name); int align_offset; ! if (name == NULL || !isdigit (name[len - 1])) return 1; if (isdigit (name[len - 2])) ------=_20070811133103_53843--