From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18434 invoked by alias); 16 Jan 2014 14:37:47 -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 18369 invoked by uid 89); 16 Jan 2014 14:37:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg21.ericsson.net Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 16 Jan 2014 14:37:45 +0000 Received: from EUSAAHC006.ericsson.se (Unknown_Domain [147.117.188.90]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id DE.45.04556.7BEE7D25; Thu, 16 Jan 2014 15:37:43 +0100 (CET) Received: from [142.133.110.254] (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.90) with Microsoft SMTP Server (TLS) id 14.2.347.0; Thu, 16 Jan 2014 09:37:42 -0500 Message-ID: <52D7EECF.5020904@ericsson.com> Date: Thu, 16 Jan 2014 14:37:00 -0000 From: Simon Marchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: GDB Patches Subject: [OB PATCH] Fix uninitialized type_flags variable Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00611.txt.bz2 If uninitialized, type_flags can contain a random value. If the arch-specific code doesn't set a value, this give unexpected results. I believe this is an obvious change. Since I don't have commit access yet, could anybody push this? gdb/ChangeLog 2014-01-16 Simon Marchi * gdbtypes.c (address_space_name_to_int): Initialize type_flags to 0. diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 042c17d..7d9485a 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -531,7 +531,7 @@ lookup_function_type_with_arguments (struct type *type, int address_space_name_to_int (struct gdbarch *gdbarch, char *space_identifier) { - int type_flags; + int type_flags = 0; /* Check for known address space delimiters. */ if (!strcmp (space_identifier, "code"))