Fix signage

pull/18/head
Shawn Webb 11 years ago
parent 89b2d2dcb9
commit f1275fb088
  1. 8
      libclamav/upx.c

@ -243,15 +243,15 @@ static int pefromupx (const char *src, uint32_t ssize, char *dst, uint32_t *dsiz
memcpy(newbuf+0xd0, pehdr,0xf8+0x28*sectcnt);
sections = pehdr+0xf8;
for (upd = 0; upd <sectcnt ; upd++) {
int32_t offset1, offset2, offset3;
offset1 = cli_readint32(sections+20);
offset2 = cli_readint32(sections+16);
uint32_t offset1, offset2, offset3;
offset1 = (uint32_t)cli_readint32(sections+20);
offset2 = (uint32_t)cli_readint32(sections+16);
if (offset1 > foffset || offset2 > foffset || offset1 + offset2 > foffset) {
free(newbuf);
return 1;
}
offset3 = cli_readint32(sections+12);
offset3 = (uint32_t)cli_readint32(sections+12);
if (offset3-upx0 > *dsize) {
free(newbuf);
return 1;

Loading…
Cancel
Save