From 4368db3219411f66f5f7a18a979e4e6c62e6595a Mon Sep 17 00:00:00 2001 From: dongshengyuan <545258830@qq.com> Date: Fri, 17 Jul 2026 10:44:03 +0800 Subject: [PATCH] boot: cover BCD offsets past the buffer Add a zero-length test for offset > max so the first bounds guard is covered separately from the length overflow check. Follow-up: 231857cfe8da749925ee2beb1352e74fa96f1372 --- src/boot/test-bcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/boot/test-bcd.c b/src/boot/test-bcd.c index d6e307b6ec..6d9603dd78 100644 --- a/src/boot/test-bcd.c +++ b/src/boot/test-bcd.c @@ -96,6 +96,7 @@ TEST(offset_bounds) { assert_se(!BAD_ARRAY(Key, key_name, 0, 0, sizeof(Key))); assert_se(bad_offset(0, sizeof(Key) + 1, sizeof(Key))); + assert_se(bad_offset(sizeof(Key) + 1, 0, sizeof(Key))); assert_se(bad_offset(UINT32_MAX, 2, UINT32_MAX)); }