From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114022 invoked by alias); 24 Sep 2015 17:30:55 -0000 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 Received: (qmail 114013 invoked by uid 89); 24 Sep 2015 17:30:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg20.ericsson.net Received: from usevmg20.ericsson.net (HELO usevmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 24 Sep 2015 17:30:53 +0000 Received: from EUSAAHC001.ericsson.se (Unknown_Domain [147.117.188.75]) by usevmg20.ericsson.net (Symantec Mail Security) with SMTP id 87.C1.32596.514D3065; Thu, 24 Sep 2015 12:44:37 +0200 (CEST) Received: from elxa4wqvvz1.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.75) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 24 Sep 2015 13:30:51 -0400 From: Antoine Tremblay To: CC: Antoine Tremblay Subject: [PATCH] Fix use of uninitialized value in linux-arm-low in GDBServer. Date: Thu, 24 Sep 2015 17:30:00 -0000 Message-ID: <1443115845-3044-1-git-send-email-antoine.tremblay@ericsson.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00562.txt.bz2 In arm_breakpoint_at, an uninitialized unsigned long was used were only 4 bytes would be written to the variable thus polluting the value on 64bit. This patch changes the value to an unsigned int. gdb/gdbserver/ChangeLog: * linux-arm-low.c (arm_breakpoint_at): Fix insn size. --- gdb/gdbserver/linux-arm-low.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c index a277bb6..b594e57 100644 --- a/gdb/gdbserver/linux-arm-low.c +++ b/gdb/gdbserver/linux-arm-low.c @@ -272,7 +272,7 @@ arm_breakpoint_at (CORE_ADDR where) else { /* ARM mode. */ - unsigned long insn; + unsigned int insn; (*the_target->read_memory) (where, (unsigned char *) &insn, 4); if (insn == arm_breakpoint) -- 1.9.1