From: Michael Schroeder Date: Thu, 20 May 2021 10:07:16 +0000 (+0200) Subject: Fix solv_zchunk decoding error if large chunks are used X-Git-Tag: 0.6.37~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=262743bfb4e3e25c477b5e06c5af73a1c61aa5ec;p=thirdparty%2Flibsolv.git Fix solv_zchunk decoding error if large chunks are used Oops. This commit is a bit embarassing. --- diff --git a/ext/solv_zchunk.c b/ext/solv_zchunk.c index 0833445f..fe8ba533 100644 --- a/ext/solv_zchunk.c +++ b/ext/solv_zchunk.c @@ -75,12 +75,12 @@ getuint(unsigned char *p, unsigned char *endp, unsigned int *dp) } if (++p < endp && (*p & 0x80) != 0) { - *dp = p[-3] ^ (p[-2] << 7) ^ (p[1] << 14) ^ ((p[0] ^ 0x80) << 21); + *dp = p[-3] ^ (p[-2] << 7) ^ (p[-1] << 14) ^ ((p[0] ^ 0x80) << 21); return p + 1; } if (++p < endp && (*p & 0xf0) == 0x80) { - *dp = p[-4] ^ (p[-3] << 7) ^ (p[2] << 14) ^ (p[1] << 21) ^ ((p[0] ^ 0x80) << 28); + *dp = p[-4] ^ (p[-3] << 7) ^ (p[-2] << 14) ^ (p[-1] << 21) ^ ((p[0] ^ 0x80) << 28); return p + 1; } return 0;