File elfutils-prevent-incorrect-memory-read.patch of Package elfutils.13244
From: Joao Moreira <jmoreira@suse.de>
Subject: elfutils prevent incorrect memory read
Upstream: No
While testing other bugs, asan caught an incorrect memory read. Thus, backport
the fix from upstream to this version, making it testable with asan.
There is no bnc for this patch.
Signed-off-by: Joao Moreira <jmoreira@suse.de>
--- a/src/readelf.c 2019-05-28 14:17:50.698464582 -0300
+++ b/src/readelf.c 2019-05-28 15:14:36.115079516 -0300
@@ -1284,10 +1284,10 @@
{
/* Determine the segment this section is part of. */
size_t cnt2;
+ GElf_Phdr phdr2_mem;
GElf_Phdr *phdr2 = NULL;
for (cnt2 = 0; cnt2 < phnum; ++cnt2)
{
- GElf_Phdr phdr2_mem;
phdr2 = gelf_getphdr (ebl->elf, cnt2, &phdr2_mem);
if (phdr2 != NULL && phdr2->p_type == PT_LOAD