added some input validity checks (for sf.net bug 3122661)

This commit is contained in:
László Molnár
2010-12-20 00:35:57 +01:00
parent 9a67ce5968
commit 1e3555a6b7
3 changed files with 11 additions and 6 deletions
+2
View File
@@ -1698,6 +1698,8 @@ void PeFile::unpack(OutputFile *fo)
extrainfo += sizeof (oh);
unsigned objs = oh.objects;
if ((int) objs <= 0)
throwCantUnpack("unexpected value in the PE header");
Array(pe_section_t, osection, objs);
memcpy(osection,extrainfo,sizeof(pe_section_t) * objs);
rvamin = osection[0].vaddr;