Fix attempted recovery from corrupted b_info

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66271&q=label%3AProj-upx
	modified:   p_lx_elf.cpp
This commit is contained in:
John Reiser
2024-05-04 10:35:39 -07:00
parent 2ea316d754
commit 4c32a8e3d4
+1 -1
View File
@@ -8618,7 +8618,7 @@ void PackLinuxElf32::unpack(OutputFile *fo)
} }
} }
int boff = find_le32(peek_arr, sizeof(peek_arr), size); int boff = find_le32(peek_arr, sizeof(peek_arr), size);
if (boff < 0) { if (boff < 0 || sizeof(peek_arr) < (sizeof(*bp) + boff)) {
throwCantUnpack("b_info corrupted"); throwCantUnpack("b_info corrupted");
} }
bp = (b_info *)(void *)&peek_arr[boff]; bp = (b_info *)(void *)&peek_arr[boff];