From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8131 invoked by alias); 12 Aug 2008 16:38:24 -0000 Received: (qmail 8121 invoked by uid 22791); 12 Aug 2008 16:38:23 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Aug 2008 16:37:44 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KSwsK-0003Fa-SJ for gdb-patches@sources.redhat.com; Tue, 12 Aug 2008 16:37:36 +0000 Received: from entropy.qnx.com ([209.226.137.107]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Aug 2008 16:37:36 +0000 Received: from aristovski by entropy.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 12 Aug 2008 16:37:36 +0000 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: [patch] nto target: fix null pointer dereference Date: Tue, 12 Aug 2008 16:38:00 -0000 Message-ID: <48A1BC48.4030104@qnx.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040302010605000101030607" Cc: Ulrich Weigand User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) 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: 2008-08/txt/msg00316.txt.bz2 This is a multi-part message in MIME format. --------------040302010605000101030607 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 159 Hello, Simple patch to fix null pointer dereference. This should make qnx target operational and usable. Thanks, Aleksandar Ristovski QNX Software Systems --------------040302010605000101030607 Content-Type: text/plain; name="nto-tdep.c-20080812.diff.ChangeLog" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nto-tdep.c-20080812.diff.ChangeLog" Content-length: 136 2008-08-12 Aleksandar Ristovski * nto-tdep.c (LM_ADDR): Make sure the address is valid before dereferencing. --------------040302010605000101030607 Content-Type: text/plain; name="nto-tdep.c-20080812.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nto-tdep.c-20080812.diff" Content-length: 580 Index: gdb/nto-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/nto-tdep.c,v retrieving revision 1.25 diff -u -p -r1.25 nto-tdep.c --- gdb/nto-tdep.c 23 Jul 2008 13:36:00 -0000 1.25 +++ gdb/nto-tdep.c 12 Aug 2008 16:33:18 -0000 @@ -266,6 +266,8 @@ LM_ADDR (struct so_list *so) { struct link_map_offsets *lmo = nto_fetch_link_map_offsets (); + if (so->lm_info->lm == NULL) + return 0; return extract_typed_address (so->lm_info->lm + lmo->l_addr_offset, builtin_type_void_data_ptr); } --------------040302010605000101030607--