]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
fix encoding of big values
authorMichael Schroeder <mls@suse.de>
Thu, 18 Oct 2012 14:09:32 +0000 (16:09 +0200)
committerMichael Schroeder <mls@suse.de>
Thu, 18 Oct 2012 14:53:16 +0000 (16:53 +0200)
src/repopack.h

index c551022b0da881057a1d2e4db1d14c5e85831e6d..81b7b88a9c89de40f399b1b0a651818eef957da8 100644 (file)
@@ -41,6 +41,7 @@ data_read_id(unsigned char *dp, Id *idp)
       *idp = x;
       return dp + 5;
     }
+  x ^= 80;
   dp += 5;
   for (;;)
     {
@@ -87,7 +88,7 @@ data_read_num64(unsigned char *dp, unsigned int *low, unsigned int *high)
       *high = (dp[0] ^ 0x80) >> 4;
       return dp + 5;
     }
-  x = (unsigned long long)(dp[0] ^ 0x80) << 28 ^ (unsigned int)(dp[1] << 21 ^ dp[2] << 14 ^ dp[3] << 7 ^ dp[4] ^ 0x10204000);
+  x = (unsigned long long)(dp[0] ^ 0x80) << 28 ^ (unsigned int)(dp[1] << 21 ^ dp[2] << 14 ^ dp[3] << 7 ^ dp[4] ^ 0x10204080);
   dp += 5;
   for (;;)
     {