From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27280 invoked by alias); 1 Aug 2007 21:15:44 -0000 Received: (qmail 27263 invoked by uid 22791); 1 Aug 2007 21:15:43 -0000 X-Spam-Check-By: sourceware.org Received: from a.mail.sonic.net (HELO a.mail.sonic.net) (64.142.16.245) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 01 Aug 2007 21:15:38 +0000 Received: from webmail.sonic.net (b.webmail.sonic.net [64.142.100.148]) by a.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id l71LFa2k000329; Wed, 1 Aug 2007 14:15:36 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Wed, 1 Aug 2007 14:15:36 -0700 (PDT) Message-ID: <6845.12.7.175.2.1186002936.squirrel@webmail.sonic.net> Date: Wed, 01 Aug 2007 21:15:00 -0000 Subject: [PATCH] opcodes/i386-dis.c, print_insn, null ptr. From: msnyder@sonic.net To: gdb-patches@sourceware.org, binutils@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: multipart/mixed;boundary="----=_20070801141536_64035" 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/msg00015.txt.bz2 ------=_20070801141536_64035 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 174 If we come to this point via the default case in the switch statement above, we will not have updated 'dp' and dp->name will still be null. Then putop will dereference it. ------=_20070801141536_64035 Content-Type: text/plain; name="19b.txt" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="19b.txt" Content-length: 1092 2007-08-01 Michael Snyder * i386-dis.c (print_insn): Guard against NULL. Index: i386-dis.c =================================================================== RCS file: /cvs/src/src/opcodes/i386-dis.c,v retrieving revision 1.131 diff -p -6 -r1.131 i386-dis.c *** i386-dis.c 29 Jul 2007 19:43:36 -0000 1.131 --- i386-dis.c 1 Aug 2007 21:11:02 -0000 *************** print_insn (bfd_vma pc, disassemble_info *** 3779,3791 **** default: oappend (INTERNAL_DISASSEMBLER_ERROR); break; } } ! if (putop (dp->name, sizeflag) == 0) { for (i = 0; i < MAX_OPERANDS; ++i) { obufp = op_out[i]; op_ad = MAX_OPERANDS - 1 - i; if (dp->op[i].rtn) --- 3779,3791 ---- default: oappend (INTERNAL_DISASSEMBLER_ERROR); break; } } ! if (dp->name != NULL && putop (dp->name, sizeflag) == 0) { for (i = 0; i < MAX_OPERANDS; ++i) { obufp = op_out[i]; op_ad = MAX_OPERANDS - 1 - i; if (dp->op[i].rtn) ------=_20070801141536_64035--