From 8f7c898c082fb8488497618ef40b75e1104c6be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Moln=C3=A1r?= Date: Tue, 16 Jan 2007 12:58:35 +0100 Subject: [PATCH] use an exception instead of assert() for overlay checking (bug #1624840) --- src/packer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packer.cpp b/src/packer.cpp index 13ff2aca..8e5f9de0 100644 --- a/src/packer.cpp +++ b/src/packer.cpp @@ -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);