From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1553 invoked by alias); 23 Apr 2017 11:48:41 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 1494 invoked by uid 89); 23 Apr 2017 11:48:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1442, lab X-HELO: mail-it0-f48.google.com Received: from mail-it0-f48.google.com (HELO mail-it0-f48.google.com) (209.85.214.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 23 Apr 2017 11:48:17 +0000 Received: by mail-it0-f48.google.com with SMTP id 70so29272425ita.0 for ; Sun, 23 Apr 2017 04:48:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=ArQysK6F1zx3RM73WGaOT46oIRzdhDvzdMulco3K4JI=; b=o1rimKz9g5eq3bQWx/8BQkEVQhfi58lqYXIu+gVfROhqHNq1hn5iPXsnPWHIRgbBxL P/SBOVajj0oMd4h4/dcw5ax9Tc0YAIoSjXNumNQfxk9FZ1tGLwLDa0Rls7oqDA0ZLDxt SYDU9DNLHTDI3qesElLxzyIIpviraDkT/nnV1LJrncMeIBBZ2FpO7XtQhGb/zyHi3+xS jw18qwkQqik9d5MlnIilSTKEliYcr5lQL0yT3IKY+5FQlSG8gteAcpYyxoGCZ2JZ4kVZ eo6nxaZUn6f79z5EONu2a4ki0PSWSh4l3SmdNYIikqefz47orKKUxO28hN7UkoVD4rLg 5j2g== X-Gm-Message-State: AN3rC/5uG3BW80a555C0TTFPsjf0INaOzY2caO/vQahNWKp6VoR2a8Fa IJPTrADh8zsoeTkk X-Received: by 10.84.230.131 with SMTP id e3mr26689212plk.100.1492948096685; Sun, 23 Apr 2017 04:48:16 -0700 (PDT) Received: from bubble.grove.modra.org (CPE-58-160-71-80.tyqh2.lon.bigpond.net.au. [58.160.71.80]) by smtp.gmail.com with ESMTPSA id w124sm13158108pgb.62.2017.04.23.04.48.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Apr 2017 04:48:16 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id DCD63C7605; Sun, 23 Apr 2017 21:18:11 +0930 (ACST) Date: Sun, 23 Apr 2017 11:48:00 -0000 From: Alan Modra To: binutils@sourceware.org Subject: PR 21408, segfault in display_debug_lines_decoded Message-ID: <20170423114811.GG24006@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00189.txt.bz2 PR 21408 * dwarf.c (display_debug_lines_decoded): Don't segfault on NULL file_table. diff --git a/binutils/ChangeLog b/binutils/ChangeLog index e833b05..a19d488 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,9 @@ +2017-04-23 Alan Modra + + PR 21408 + * dwarf.c (display_debug_lines_decoded): Don't segfault on NULL + file_table. + 2017-04-21 Nick Clifton PR binutils/21378 diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 559d6f8..bb141e4 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -3808,11 +3808,10 @@ display_debug_lines_decoded (struct dwarf_section *section, } /* Print the Compilation Unit's name and a header. */ - if (directory_table == NULL) - { - printf (_("CU: %s:\n"), file_table[0].name); - printf (_("File name Line number Starting address\n")); - } + if (file_table == NULL) + ; + else if (directory_table == NULL) + printf (_("CU: %s:\n"), file_table[0].name); else { unsigned int ix = file_table[0].directory_index; @@ -3836,10 +3835,9 @@ display_debug_lines_decoded (struct dwarf_section *section, printf (_("CU: %s/%s:\n"), directory, file_table[0].name); else printf ("%s:\n", file_table[0].name); - - printf (_("File name Line number Starting address\n")); } + printf (_("File name Line number Starting address\n")); saved_linfo = linfo; } -- Alan Modra Australia Development Lab, IBM