From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31663 invoked by alias); 25 Jul 2007 22:14:05 -0000 Received: (qmail 31655 invoked by uid 22791); 25 Jul 2007 22:14:04 -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; Wed, 25 Jul 2007 22:14:02 +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 l6PME0kr031699 for ; Wed, 25 Jul 2007 15:14:01 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Wed, 25 Jul 2007 15:14:00 -0700 (PDT) Message-ID: <24363.12.7.175.2.1185401640.squirrel@webmail.sonic.net> Date: Wed, 25 Jul 2007 22:42:00 -0000 Subject: [PATCH] reloc.c, null ptr guard From: msnyder@sonic.net To: binutils@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070725151400_78254" 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/msg00422.txt.bz2 ------=_20070725151400_78254 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 91 If reloc_size is zero, we could reach this point with a null pointer, and dereference it. ------=_20070725151400_78254 Content-Type: text/plain; name="reloc2.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="reloc2.txt" Content-length: 876 2007-07-25 Michael Snyder * reloc.c (bfd_generic_get_relocated_section_contents): Guard against null pointer reference. Index: reloc.c =================================================================== RCS file: /cvs/src/src/bfd/reloc.c,v retrieving revision 1.168 diff -p -r1.168 reloc.c *** reloc.c 3 Jul 2007 14:26:42 -0000 1.168 --- reloc.c 25 Jul 2007 22:11:50 -0000 *************** bfd_generic_get_relocated_section_conten *** 5213,5219 **** if (reloc_count < 0) goto error_return; ! if (reloc_count > 0) { arelent **parent; for (parent = reloc_vector; *parent != NULL; parent++) --- 5213,5219 ---- if (reloc_count < 0) goto error_return; ! if (reloc_count > 0 && reloc_vector != NULL) { arelent **parent; for (parent = reloc_vector; *parent != NULL; parent++) ------=_20070725151400_78254--