From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from kwanyin.sergiodj.net (kwanyin.sergiodj.net [158.69.185.54]) by sourceware.org (Postfix) with ESMTPS id D08BB389781F for ; Tue, 19 May 2020 17:42:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D08BB389781F Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [binutils-gdb] Fix thinko in recent update to bfd_section_from_shdr. From: gdb-buildbot@sergiodj.net To: gdb-testers@sourceware.org Message-Id: <6fd1d259e98354236fafd14ec05f3d6a377ede9f@gdb-build> Date: Tue, 19 May 2020 13:42:06 -0400 X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-testers@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-testers mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 17:42:08 -0000 *** TEST RESULTS FOR COMMIT 6fd1d259e98354236fafd14ec05f3d6a377ede9f *** commit 6fd1d259e98354236fafd14ec05f3d6a377ede9f Author: Gunther Nikl AuthorDate: Tue May 19 17:32:26 2020 +0100 Commit: Nick Clifton CommitDate: Tue May 19 17:32:26 2020 +0100 Fix thinko in recent update to bfd_section_from_shdr. PR 26005 * elf.c (bfd_section_from_shdr): Replace bfd_malloc + memset with bfd_zmalloc to allocate memory for the sections_being_created array. diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 7ec1ce3e86..cb168f1768 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2020-05-19 Gunther Nikl + + PR 26005 + * elf.c (bfd_section_from_shdr): Replace bfd_malloc + memset with + bfd_zmalloc to allocate memory for the sections_being_created array. + 2020-05-19 Stafford Horne * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Rename srela diff --git a/bfd/elf.c b/bfd/elf.c index c74d95b442..40943781bc 100644 --- a/bfd/elf.c +++ b/bfd/elf.c @@ -2075,9 +2075,9 @@ bfd_section_from_shdr (bfd *abfd, unsigned int shindex) /* PR 26005: Do not use bfd_zalloc here as the memory might be released before the bfd has been fully scanned. */ sections_being_created = (bfd_boolean *) bfd_malloc (amt); - memset (sections_being_created, FALSE, amt); if (sections_being_created == NULL) return FALSE; + memset (sections_being_created, FALSE, amt); sections_being_created_abfd = abfd; } if (sections_being_created [shindex])