58 lines
2.1 KiB
Diff
58 lines
2.1 KiB
Diff
From adcae42c2094096606a26976fb5829aa1ce5937b Mon Sep 17 00:00:00 2001
|
|
From: caodongxia <315816521@qq.com>
|
|
Date: Mon, 31 May 2021 16:43:12 +0800
|
|
Subject: [PATCH] create patch
|
|
|
|
---
|
|
libclamav/upx.c | 6 +++---
|
|
libclammspack/mspack/cabd.c | 2 +-
|
|
2 files changed, 4 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/libclamav/upx.c b/libclamav/upx.c
|
|
index 4663861..0e7b2c8 100644
|
|
--- a/libclamav/upx.c
|
|
+++ b/libclamav/upx.c
|
|
@@ -333,7 +333,7 @@ int upx_inflate2b(const char *src, uint32_t ssize, char *dst, uint32_t *dsize, u
|
|
return -1;
|
|
if (backbytes & 0xff000000)
|
|
return -1;
|
|
- backbytes <<= 8;
|
|
+ backbytes = (int32_t)((uint32_t)(backbytes) << 8);
|
|
backbytes += (unsigned char)(src[scur++]);
|
|
backbytes ^= 0xffffffff;
|
|
|
|
@@ -425,7 +425,7 @@ int upx_inflate2d(const char *src, uint32_t ssize, char *dst, uint32_t *dsize, u
|
|
return -1;
|
|
if (backbytes & 0xff000000)
|
|
return -1;
|
|
- backbytes <<= 8;
|
|
+ backbytes = (int32_t)((uint32_t)(backbytes) << 8);
|
|
backbytes += (unsigned char)(src[scur++]);
|
|
backbytes ^= 0xffffffff;
|
|
|
|
@@ -517,7 +517,7 @@ int upx_inflate2e(const char *src, uint32_t ssize, char *dst, uint32_t *dsize, u
|
|
return -1;
|
|
if (backbytes & 0xff000000)
|
|
return -1;
|
|
- backbytes <<= 8;
|
|
+ backbytes = (int32_t)((uint32_t)(backbytes) << 8);
|
|
backbytes += (unsigned char)(src[scur++]);
|
|
backbytes ^= 0xffffffff;
|
|
|
|
diff --git a/libclammspack/mspack/cabd.c b/libclammspack/mspack/cabd.c
|
|
index 75ef277..4dffd6b 100644
|
|
--- a/libclammspack/mspack/cabd.c
|
|
+++ b/libclammspack/mspack/cabd.c
|
|
@@ -1398,7 +1398,7 @@ static unsigned int cabd_checksum(unsigned char *data, unsigned int bytes,
|
|
unsigned int len, ul = 0;
|
|
|
|
for (len = bytes >> 2; len--; data += 4) {
|
|
- cksum ^= ((data[0]) | (data[1]<<8) | (data[2]<<16) | (data[3]<<24));
|
|
+ cksum ^= ((data[0]) | ((unsigned int)(data[1])<<8) | ((unsigned int)(data[2])<<16) | ((unsigned int)(data[3])<<24));
|
|
}
|
|
|
|
switch (bytes & 3) {
|
|
--
|
|
2.27.0
|
|
|