]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Fix off by one in cshash dedup code
authorMichael Schroeder <mls@suse.de>
Tue, 17 May 2016 09:29:50 +0000 (11:29 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 17 May 2016 09:29:50 +0000 (11:29 +0200)
Actually no harm done without the commit, the duplicates are
simply ignored.

ext/repo_rpmmd.c

index d280ba0e4cddd72135a625101071e6c8519c0867..729f4f7cab65c0c04ca9088a5585bbc3913a3662 100644 (file)
@@ -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);
        }