1
0
mirror of https://github.com/upx/upx synced 2025-10-05 19:20:23 +08:00

Allocate larger xtrasize based on ih.datasize.

committer: mfx <mfx> 1110936001 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2005-03-16 01:20:01 +00:00
parent 0866a1996b
commit 7371c195ff

View File

@ -1660,7 +1660,7 @@ void PackW32Pe::pack(OutputFile *fo)
handleStub(fi,fo,pe_offset);
const unsigned usize = ih.imagesize;
const unsigned xtrasize = 65536+IDSIZE(PEDIR_IMPORT)+IDSIZE(PEDIR_BOUNDIM)+IDSIZE(PEDIR_IAT)+IDSIZE(PEDIR_DELAYIMP)+IDSIZE(PEDIR_RELOC);
const unsigned xtrasize = UPX_MAX(ih.datasize, 65536u) + IDSIZE(PEDIR_IMPORT) + IDSIZE(PEDIR_BOUNDIM) + IDSIZE(PEDIR_IAT) + IDSIZE(PEDIR_DELAYIMP) + IDSIZE(PEDIR_RELOC);
ibuf.alloc(usize + xtrasize);
// BOUND IMPORT support. FIXME: is this ok?