From cde41f48491e419a95c0997fda2f89692a4e44c1 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Tue, 13 Aug 2024 10:11:49 +0800 Subject: [PATCH] system/fastboot: Fix Out-of-bounds Write MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CID 329130: (#3 of 3): 越界写入 (OVERRUN) 6. overrun-local: 在字节偏移 64 处使用索引 r(其值为 64)越界 64 字节访问数组 buffer Signed-off-by: wangjianyu3 --- system/fastboot/fastboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index 2041dfee659..dfd46cc2718 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -847,7 +847,7 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *context) while (1) { - char buffer[FASTBOOT_MSG_LEN]; + char buffer[FASTBOOT_MSG_LEN + 1]; size_t ncmds = nitems(g_fast_cmd); size_t index;