1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

Avoid trouble: disallow empty name of export directory

https://github.com/upx/upx/issues/425
	modified:   pefile.cpp
This commit is contained in:
John Reiser 2022-08-13 12:25:30 -07:00 committed by Markus F.X.J. Oberhumer
parent bfd2153f2b
commit dadbbbdc64

View File

@ -1143,7 +1143,7 @@ void PeFile::Export::convert(unsigned eoffs,unsigned esize)
size = sizeof(export_dir_t);
iv.add(eoffs,size);
if (eoffs + esize <= (unsigned)edir.name) {
if (!edir.name || eoffs + esize <= (unsigned)edir.name) {
char msg[50]; snprintf(msg, sizeof(msg),
"bad export directory name RVA %#x", (unsigned)edir.name);
throwInternalError(msg);