re PR plugins/90924 (lto-plugin/lto-plugin.c heap memory corruption due to insufficient sanitization.)

2019-07-25  Richard Biener  <rguenther@suse.de>

	PR lto/90924
	Backport from mainline
	2019-07-12  Ren Kimura  <rkx1209dev@gmail.com>

	* simple-object-elf.c (simple_object_elf_match): Check zero value
	shstrndx.

From-SVN: r273793
This commit is contained in:
Richard Biener 2019-07-25 10:46:54 +00:00 committed by Richard Biener
parent e58ac8a6a2
commit daa31aea30
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2019-07-25 Richard Biener <rguenther@suse.de>
PR lto/90924
Backport from mainline
2019-07-12 Ren Kimura <rkx1209dev@gmail.com>
* simple-object-elf.c (simple_object_elf_match): Check zero value
shstrndx.
2019-05-03 Release Manager
* GCC 9.1.0 released.

View File

@ -549,6 +549,14 @@ simple_object_elf_match (unsigned char header[SIMPLE_OBJECT_MATCH_HEADER_LEN],
return NULL;
}
if (eor->shstrndx == 0)
{
*errmsg = "invalid ELF shstrndx == 0";
*err = 0;
XDELETE (eor);
return NULL;
}
return (void *) eor;
}