From 98a55b2c1388dc3d0da83e7623b5425a7b5a603e Mon Sep 17 00:00:00 2001 From: apio Date: Wed, 7 Dec 2022 14:46:11 +0100 Subject: [PATCH] Bitmap: Fix crash by attempting to memset -1 bits (UINT64_MAX) --- luna/src/Bitmap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luna/src/Bitmap.cpp b/luna/src/Bitmap.cpp index a29fc947..7fb5302b 100644 --- a/luna/src/Bitmap.cpp +++ b/luna/src/Bitmap.cpp @@ -65,10 +65,11 @@ void Bitmap::clear_region(usize start, usize bits, bool value) if (!bits) return; // Set individual bits while not on a byte boundary. - while ((start % 8) && bits--) + while ((start % 8) && bits) { set(start, value); start++; + bits--; } // Clear out the rest in bytes.