mirror of
https://github.com/upx/upx
synced 2025-09-28 19:06:07 +08:00
PeFile::rebuildImports(): Allow strlen() up to the very end of a logical block
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=65650 https://github.com/upx/upx/issues/769 modified: pefile.cpp
This commit is contained in:
parent
e4a611bcae
commit
2ad0d51226
|
@ -2948,10 +2948,12 @@ void PeFile::unpack0(OutputFile *fo, const ht &ih, ht &oh, ord_mask_t ord_mask,
|
||||||
|
|
||||||
if (iobjs > 2) {
|
if (iobjs > 2) {
|
||||||
// read the noncompressed section
|
// read the noncompressed section
|
||||||
|
unsigned const size = isection[2].size;
|
||||||
ibuf.dealloc();
|
ibuf.dealloc();
|
||||||
ibuf.alloc(isection[2].size);
|
ibuf.alloc(size + 1);
|
||||||
fi->seek(isection[2].rawdataptr, SEEK_SET);
|
fi->seek(isection[2].rawdataptr, SEEK_SET);
|
||||||
fi->readx(ibuf, ibufgood = isection[2].size);
|
fi->readx(ibuf, ibufgood = size);
|
||||||
|
ibuf[size] = 0; // allow strlen() up to 'size'
|
||||||
}
|
}
|
||||||
|
|
||||||
// unfilter
|
// unfilter
|
||||||
|
|
Loading…
Reference in New Issue
Block a user