use an exception instead of assert() for overlay checking (bug #1624840)
This commit is contained in:
+2
-2
@@ -546,8 +546,8 @@ void Packer::handleStub(InputFile *fif, OutputFile *fo, long size)
|
|||||||
|
|
||||||
void Packer::checkOverlay(unsigned overlay)
|
void Packer::checkOverlay(unsigned overlay)
|
||||||
{
|
{
|
||||||
assert((int)overlay >= 0);
|
if ((int)overlay < 0 || (off_t)overlay > file_size)
|
||||||
assert((off_t)overlay < file_size);
|
throw OverlayException("invalid overlay size; file is possibly corrupt");
|
||||||
if (overlay == 0)
|
if (overlay == 0)
|
||||||
return;
|
return;
|
||||||
info("Found overlay: %d bytes", overlay);
|
info("Found overlay: %d bytes", overlay);
|
||||||
|
|||||||
Reference in New Issue
Block a user