From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16932 invoked by alias); 26 Feb 2011 22:52:29 -0000 Received: (qmail 16923 invoked by uid 22791); 26 Feb 2011 22:52:28 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 Feb 2011 22:52:24 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 724591800C; Sat, 26 Feb 2011 14:52:23 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost3.vmware.com (Postfix) with ESMTP id 66E94CD96A; Sat, 26 Feb 2011 14:52:23 -0800 (PST) Message-ID: <4D698427.2050301@vmware.com> Date: Sat, 26 Feb 2011 23:24:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , Doug Evans Subject: [RFA] off by one array reference in i386-low.c/i386_show_dr Content-Type: multipart/mixed; boundary="------------060501020806050905020602" 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: 2011-02/txt/msg00812.txt.bz2 This is a multi-part message in MIME format. --------------060501020806050905020602 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 154 Doug, I'm not 100 percent sure this is right, but I do know that as written, it will overflow the array dr_mirror. What do you think? Thanks, Michael --------------060501020806050905020602 Content-Type: text/plain; name="offbyone2.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="offbyone2.txt" Content-length: 752 2011-02-26 Michael Snyder * i386-low.c (i386_show_dr): Fix off-by-one array reference. Index: i386-low.c =================================================================== RCS file: /cvs/src/src/gdb/gdbserver/i386-low.c,v retrieving revision 1.5 diff -u -p -u -p -r1.5 i386-low.c --- i386-low.c 1 Jan 2011 15:33:24 -0000 1.5 +++ i386-low.c 26 Feb 2011 22:48:38 -0000 @@ -195,7 +195,7 @@ i386_show_dr (struct i386_debug_reg_stat \tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n", i, paddress (state->dr_mirror[i]), state->dr_ref_count[i], - i + 1, paddress (state->dr_mirror[i + 1]), + i + 1, paddress (state->dr_mirror[i]), state->dr_ref_count[i + 1]); i++; } --------------060501020806050905020602--