From: dongshengyuan <545258830@qq.com> Date: Fri, 17 Jul 2026 02:44:03 +0000 (+0800) Subject: boot: cover BCD offsets past the buffer X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4368db3219411f66f5f7a18a979e4e6c62e6595a;p=thirdparty%2Fsystemd.git 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 --- diff --git a/src/boot/test-bcd.c b/src/boot/test-bcd.c index d6e307b6ecf..6d9603dd78a 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)); }