[PATCH v2 2/6] bitmap: test bitmap_parse() with an illegal character before 8 hex digits
From: Shashank Mohan Jain
Date: Fri Sep 25 2026 - 21:27:28 EST
Add bitmap_parse() cases where an illegal character directly precedes a
chunk of eight hex digits. These were accepted before the previous
patch and must return -EINVAL.
Assisted-by: LLM
Signed-off-by: Shashank Mohan Jain <jain.sm@xxxxxxxxx>
---
lib/test_bitmap.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/test_bitmap.c b/lib/test_bitmap.c
index 56bd23059b26..35bb18f6e326 100644
--- a/lib/test_bitmap.c
+++ b/lib/test_bitmap.c
@@ -643,6 +643,10 @@ static const struct test_bitmap_parselist parse_tests[] __initconst = {
{-EOVERFLOW, "badf00d,deadbeef,1,0", NULL, 90, 0},
{-EOVERFLOW, "fbadf00d,deadbeef,1,0", NULL, 95, 0},
{-EOVERFLOW, "badf00d,deadbeef,1,0", NULL, 100, 0},
+
+ {-EINVAL, "x12345678", NULL, 32, 0},
+ {-EINVAL, "1g12345678", NULL, 64, 0},
+ {-EINVAL, "0x0000000f", NULL, 64, 0},
#undef step
};
--
2.43.0