Check when optimizeRelocs()

https://github.com/upx/upx/issues/513
	modified:   packer.h
	modified:   packer.cpp
	modified:   pefile.cpp
	modified:   p_wcle.cpp
	modified:   p_tmt.cpp
This commit is contained in:
John Reiser
2021-12-29 16:57:52 -08:00
committed by Markus F.X.J. Oberhumer
parent be23f93ee6
commit ea567a8b14
5 changed files with 48 additions and 19 deletions
+2 -2
View File
@@ -441,7 +441,7 @@ void PeFile32::processRelocs() // pass1
mb_orelocs.alloc(mem_size(4, rnum, 1024)); // 1024 - safety
orelocs = (upx_byte *)mb_orelocs.getVoidPtr();
sorelocs = ptr_diff(optimizeReloc32((upx_byte*) fix[3], xcounts[3],
orelocs, ibuf + rvamin, 1, &big_relocs),
orelocs, ibuf + rvamin, file_size - rvamin, 1, &big_relocs),
orelocs);
delete [] fix[3];
@@ -547,7 +547,7 @@ void PeFile64::processRelocs() // pass1
mb_orelocs.alloc(mem_size(4, rnum, 1024)); // 1024 - safety
orelocs = (upx_byte *)mb_orelocs.getVoidPtr();
sorelocs = ptr_diff(optimizeReloc64((upx_byte*) fix[10], xcounts[10],
orelocs, ibuf + rvamin, 1, &big_relocs),
orelocs, ibuf + rvamin, file_size - rvamin, 1, &big_relocs),
orelocs);
for (ic = 15; ic; ic--)