Some cleanups.

committer: mfx <mfx> 962208107 +0000
This commit is contained in:
Markus F.X.J. Oberhumer
2000-06-28 16:01:47 +00:00
parent 51c6566092
commit 3980081a5a
5 changed files with 39 additions and 22 deletions
+7
View File
@@ -166,6 +166,9 @@ bool PackHeader::fillPackHeader(upx_bytep buf, unsigned len)
if (l == 0)
return false;
buf_offset = l - buf;
const int hlen = len - buf_offset;
if (hlen < 8)
return false;
version = l[4];
format = l[5];
@@ -173,6 +176,10 @@ bool PackHeader::fillPackHeader(upx_bytep buf, unsigned len)
level = l[7];
filter_cto = 0;
const int hs = getPackHeaderSize();
if (hs > hlen)
throwCantUnpack("header corrupted");
// the new variable length header
int off_filter = 0;
if (format < 128)