headway vs size

https://github.com/upx/upx/issues/414
	modified:   packhead.cpp
This commit is contained in:
John Reiser 2020-11-06 14:25:36 -08:00 committed by Markus F.X.J. Oberhumer
parent 6ce625b535
commit 1805cb6857

View File

@ -278,7 +278,7 @@ bool PackHeader::fillPackHeader(const upx_bytep buf, int blen) {
// check header_checksum
if (version > 9) {
unsigned const size = getPackHeaderSize(); // expected; based on format and version
if (size < headway
if (headway < size
|| p[size - 1] != get_packheader_checksum(p, size - 1))
throwCantUnpack("header corrupted 3");
}