From 627557348319c38c95e7ca9222c18400fef8721c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20Mat=C4=9Bj?= Date: Fri, 6 Mar 2026 09:25:17 +0100 Subject: [PATCH] map_and: fix writing outside of target map memory `ti` already points somewhere in the target, depending on the source size, adding full `t->size` goes out of bounds. --- src/bitmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitmap.c b/src/bitmap.c index 2a708342..d482eddc 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -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; } -- 2.47.3