From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7976 invoked by alias); 24 Jul 2007 20:56:15 -0000 Received: (qmail 7968 invoked by uid 22791); 24 Jul 2007 20:56:14 -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:56:12 +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 l6OKuAef000734 for ; Tue, 24 Jul 2007 13:56:10 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Tue, 24 Jul 2007 13:56:10 -0700 (PDT) Message-ID: <12546.12.7.175.2.1185310570.squirrel@webmail.sonic.net> Date: Tue, 24 Jul 2007 22:19:00 -0000 Subject: [PATCH] linker.c, null string From: msnyder@sonic.net To: binutils@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070724135610_62630" Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00383.txt.bz2 ------=_20070724135610_62630 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 134 Shouldn't use NULL to denote an invalid string, because the pointer will be passed to functions that will dereference it (Coverity). ------=_20070724135610_62630 Content-Type: text/plain; name="string.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="string.txt" Content-length: 830 2007-07-24 Michael Snyder * linker.c (generic_link_add_symbol_list): Use an invalid string rather than null, since the pointer will be dereferenced. Index: linker.c =================================================================== RCS file: /cvs/src/src/bfd/linker.c,v retrieving revision 1.59 diff -p -r1.59 linker.c *** linker.c 3 Jul 2007 14:26:42 -0000 1.59 --- linker.c 24 Jul 2007 20:53:38 -0000 *************** generic_link_add_symbol_list (bfd *abfd, *** 1334,1340 **** name = bfd_asymbol_name (*pp); } else ! string = NULL; bh = NULL; if (! (_bfd_generic_link_add_one_symbol --- 1334,1340 ---- name = bfd_asymbol_name (*pp); } else ! string = "*invalid*"; bh = NULL; if (! (_bfd_generic_link_add_one_symbol ------=_20070724135610_62630--