From: Michael Schroeder Date: Tue, 17 May 2016 09:29:50 +0000 (+0200) Subject: Fix off by one in cshash dedup code X-Git-Tag: 0.6.21~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8ff1f493023e30bb21a8ad0e939a464e353ce46;p=thirdparty%2Flibsolv.git Fix off by one in cshash dedup code Actually no harm done without the commit, the duplicates are simply ignored. --- diff --git a/ext/repo_rpmmd.c b/ext/repo_rpmmd.c index d280ba0e..729f4f7c 100644 --- a/ext/repo_rpmmd.c +++ b/ext/repo_rpmmd.c @@ -651,7 +651,7 @@ put_in_cshash(struct parsedata *pd, const unsigned char *key, int keyl, Id id) while (ht[h]) { unsigned char *d = pd->csdata + ht[h]; - if (d[-1] == keyl && !memcmp(key, d, keyl)) + if (d[-1] == keyl - 1 && !memcmp(key, d, keyl)) return; /* XXX: first id wins... */ h = HASHCHAIN_NEXT(h, hh, hm); }