]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
map_and: fix writing outside of target map memory 609/head
authorAleš Matěj <amatej@redhat.com>
Fri, 6 Mar 2026 08:25:17 +0000 (09:25 +0100)
committerAleš Matěj <amatej@redhat.com>
Fri, 6 Mar 2026 08:27:45 +0000 (09:27 +0100)
`ti` already points somewhere in the target, depending on the source
size, adding full `t->size` goes out of bounds.

src/bitmap.c

index 2a708342a1be6c8d078e8c54bcdbdb82565444f0..d482eddc6226071995980c07e668384e95c78dad 100644 (file)
@@ -69,7 +69,7 @@ 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;
+  end = t->map + t->size;
   while (ti < end)
     *ti++ = 0;
 }