]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
map_and: fix different size case
authorMichael Schroeder <mls@suse.de>
Tue, 19 Aug 2025 14:55:13 +0000 (16:55 +0200)
committerMichael Schroeder <mls@suse.de>
Tue, 3 Feb 2026 12:04:18 +0000 (13:04 +0100)
Clear the remaining target bits if the source is smaller than the
target.

src/bitmap.c

index 4e8adbd38629164e85a8384b3bbd2e7b7be2918d..2a708342a1be6c8d078e8c54bcdbdb82565444f0 100644 (file)
@@ -69,6 +69,9 @@ map_and(Map *t, const Map *s)
   end = ti + (t->size < s->size ? t->size : s->size);
   while (ti < end)
     *ti++ &= *si++;
+  end = ti + t->size;
+  while (ti < end)
+    *ti++ = 0;
 }
 
 /* bitwise-ors maps t and s, stores the result in t. */