From a7a7f2f1065016059cc71bee8b468f885daa45c4 Mon Sep 17 00:00:00 2001 From: orbisai0security Date: Tue, 12 May 2026 16:10:28 +0000 Subject: [PATCH] fix: V-001 security vulnerability Automated security fix generated by Orbis Security AI --- src/fetch/common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fetch/common.h b/src/fetch/common.h index 57a1a8e6..16349f5f 100644 --- a/src/fetch/common.h +++ b/src/fetch/common.h @@ -33,7 +33,7 @@ void get_layout_abbr(char *abbr, const char *full_name) { // 1. 尝试在映射表中查找 for (int32_t i = 0; layout_mappings[i].full_name != NULL; i++) { if (strcmp(full_name, layout_mappings[i].full_name) == 0) { - strcpy(abbr, layout_mappings[i].abbr); + snprintf(abbr, 32, "%s", layout_mappings[i].abbr); return; } } @@ -73,7 +73,7 @@ void get_layout_abbr(char *abbr, const char *full_name) { abbr[2] = '\0'; } else { // 5. 最终回退:返回 "xx" - strcpy(abbr, "xx"); + snprintf(abbr, 32, "xx"); } }