Skip to content

Commit bc04a27

Browse files
committed
fix a minor issue PP20 depacker:
The PowerPacker 2.0 depacker could attempt to skip more than 32 bits in a manner that results in invalid shifts. These files are now rejected. The source of a decompilation project suggests that skip values greater than 32 are impossible anyway. Ported from libxmp/libxmp#492, patch authored by Alice Rowan.
1 parent 95e0af5 commit bc04a27

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mmcmp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ BOOL PP20_Unpack(LPCBYTE *ppMemFile, LPDWORD pdwMemLength)
514514
memcpy(tmp,&lpMemFile[dwMemLength-4],4);
515515
dwDstLen = (tmp[0]<<16) | (tmp[1]<<8) | tmp[2];
516516
skip = tmp[3];
517+
if (skip > 32) return 0;
517518

518519
/* original pp20 only support efficiency
519520
* from 9 9 9 9 up to 9 10 12 13, afaik,

0 commit comments

Comments
 (0)