mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
use an exception instead of assert() for overlay checking (bug #1624840)
This commit is contained in:
parent
f4a9815f48
commit
8f7c898c08
|
@ -546,8 +546,8 @@ void Packer::handleStub(InputFile *fif, OutputFile *fo, long size)
|
|||
|
||||
void Packer::checkOverlay(unsigned overlay)
|
||||
{
|
||||
assert((int)overlay >= 0);
|
||||
assert((off_t)overlay < file_size);
|
||||
if ((int)overlay < 0 || (off_t)overlay > file_size)
|
||||
throw OverlayException("invalid overlay size; file is possibly corrupt");
|
||||
if (overlay == 0)
|
||||
return;
|
||||
info("Found overlay: %d bytes", overlay);
|
||||
|
|
Loading…
Reference in New Issue
Block a user