From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20529 invoked by alias); 11 Mar 2011 21:15:10 -0000 Received: (qmail 20474 invoked by uid 22791); 11 Mar 2011 21:15:10 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,KAM_STOCKTIP,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 Mar 2011 21:15:06 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id E020C1348D; Fri, 11 Mar 2011 13:15:04 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost4.vmware.com (Postfix) with ESMTP id D48BDC9F6F; Fri, 11 Mar 2011 13:15:04 -0800 (PST) Message-ID: <4D7A90D8.8060903@vmware.com> Date: Fri, 11 Mar 2011 21:35:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20110128) MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" Subject: Re: [RFA] stabsread.c (define_symbol): Guard against bad stabstring input. References: <4D7185C5.70505@vmware.com> <201103050042.59285.pedro@codesourcery.com> <201103050049.14785.pedro@codesourcery.com> In-Reply-To: <201103050049.14785.pedro@codesourcery.com> Content-Type: multipart/mixed; boundary="------------040800080608030807000401" X-IsSubscribed: yes 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: 2011-03/txt/msg00674.txt.bz2 This is a multi-part message in MIME format. --------------040800080608030807000401 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Content-length: 799 Pedro Alves wrote: > On Saturday 05 March 2011 00:42:59, Pedro Alves wrote: >> On Saturday 05 March 2011 00:37:25, Michael Snyder wrote: >>> I think I heard someone say that gdb should be proof against all inputs? >> Yes, but bad inputs aren't gdb bugs, so those should be errors >> or warnings, not internal_errors. > > for completeness: ... or "complaints", of which the symbol > readers are the biggest users, exactly to complain about > bad input debug info. complaints have the nice property > that they warn once, and go quiet the next time the problem > appears --- when we see a malformed debug info problem, we > tend to see a lot of instances of the same in the same run, > so that feature prevents terminal flooding with a bunch of > duplicated warnings. > Thanks. How about this? --------------040800080608030807000401 Content-Type: text/plain; name="null13b.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="null13b.txt" Content-length: 719 2011-03-04 Michael Snyder * stabsread.c (define_symbol): Guard against bad stabstring input. Index: stabsread.c =================================================================== RCS file: /cvs/src/src/gdb/stabsread.c,v retrieving revision 1.136 diff -u -p -r1.136 stabsread.c --- stabsread.c 28 Feb 2011 23:32:27 -0000 1.136 +++ stabsread.c 11 Mar 2011 21:11:44 -0000 @@ -636,6 +636,12 @@ define_symbol (CORE_ADDR valu, char *str { p += 2; p = strchr (p, ':'); + if (p == NULL) + { + complaint (&symfile_complaints, + _("Bad stabs string '%s'"), string); + return NULL; + } } /* If a nameless stab entry, all we need is the type, not the symbol. --------------040800080608030807000401--