'sizeof' returns size_t, which on i386 is not as wide as off_t

https://github.com/upx/upx/issues/629
https://github.com/upx/upx/issues/635
	modified:   p_lx_elf.cpp
This commit is contained in:
John Reiser 2022-12-20 07:21:02 -08:00 committed by Markus F.X.J. Oberhumer
parent f2a68023fa
commit 1bed77e4d3

View File

@ -5408,7 +5408,7 @@ void PackLinuxElf64::unpack(OutputFile *fo)
{ // Recover from some piracy [also serves as error tolerance :-) ]
b_info b_peek;
fi->readx(&b_peek, sizeof(b_peek));
upx_off_t pos = fi->seek(0u - sizeof(b_peek), SEEK_CUR);
upx_off_t pos = fi->seek(-(off_t)sizeof(b_peek), SEEK_CUR);
if (b_peek.sz_unc != size
|| b_peek.b_method != prev_method) {
opt->info_mode++;