[PATCH] libiberty: Check zero value shstrndx in simple-object-elf.c

2019-07-12 Thread Ren Kimura
line "(eor->shstrndx - 1)". A result becomes negative value (unsigned int)-1 and cause memory corruption. Signed-off-by: Ren Kimura --- libiberty/simple-object-elf.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libiberty/simple-object-elf.c b/libib

[PATCH v2] libiberty: Check zero value shstrndx in simple-object-elf.c

2019-07-12 Thread Ren Kimura
line "(eor->shstrndx - 1)". A result becomes negative value (unsigned int)-1 and causes memory corruption. Signed-off-by: Ren Kimura --- libiberty/simple-object-elf.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libiberty/simple-object-elf.c b/libib

Re: [PATCH v2] libiberty: Check zero value shstrndx in simple-object-elf.c

2019-07-12 Thread Ren Kimura
Oh. I missed a ChangeLog entry. Hold on... I'll send v3 patch. Thanks 2019年7月12日(金) 19:37 Ren Kimura : > > This patch fixes a Bug 90924. > simple_object_elf functions don't load section table 0 of ELF file, which is > not a useful. > However If e_shstrndx in ELF header

[PATCH v3] libiberty: Check zero value shstrndx in simple-object-elf.c

2019-07-12 Thread Ren Kimura
line "(eor->shstrndx - 1)". A result becomes negative value (unsigned int)-1 and causes memory corruption. Signed-off-by: Ren Kimura --- libiberty/ChangeLog | 5 + libiberty/simple-object-elf.c | 10 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff