Some cleanups.
committer: mfx <mfx> 962208107 +0000
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user