From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2239 invoked by alias); 3 Jul 2007 00:40:17 -0000 Received: (qmail 2231 invoked by uid 22791); 3 Jul 2007 00:40:16 -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, 03 Jul 2007 00:40:14 +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 l630eCPs028052; Mon, 2 Jul 2007 17:40:12 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Mon, 2 Jul 2007 17:40:12 -0700 (PDT) Message-ID: <5627.12.7.175.2.1183423212.squirrel@webmail.sonic.net> In-Reply-To: <20070701160007.GG10872@caradoc.them.org> References: <17674.12.7.175.2.1183064463.squirrel@webmail.sonic.net> <20070701160007.GG10872@caradoc.them.org> Date: Tue, 03 Jul 2007 00:40:00 -0000 Subject: Re: [PATCH] null pointer guard, target-descriptions.c From: msnyder@sonic.net To: msnyder@sonic.net, gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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/msg00043.txt.bz2 > On Thu, Jun 28, 2007 at 02:01:03PM -0700, Michael Snyder wrote: >> Possible null pointer ref, flagged by Coverity >> > >> 2007-06-28 Michael Snyder >> >> * target-descriptions.c (tdesc-_named_type): Guard against null >> type-id argument which may be passed by tdesc_create_reg (Coverity). > > Whoops, yeah - this one's my fault. There's another place in the same > file which will crash if reg->type == NULL. How about we never set it > to NULL instead? Like below. That certainly solves the issue for now -- since it's only called from one place -- but if we just went ahead and checked it for null, we wouldn't have to worry about it coming up again. But it's your code, so your choice... if you prefer your patch, consider this approval. ;-)