1 Star 0 Fork 10

jinlun/dim_9

forked from src-openEuler/dim 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-update-src-common-dim_baseline.c.patch 1003 Bytes
一键复制 编辑 原始数据 按行查看 历史
jinlun 提交于 2024-04-16 10:12 . backport some patches
From ee0e50754cb5bf5943d4f16508725b3f65931f24 Mon Sep 17 00:00:00 2001
From: lixiang_yewu <lixiang_yewu@cmss.chinamobile.com>
Date: Tue, 2 Jan 2024 02:27:55 +0000
Subject: [PATCH 09/26] update src/common/dim_baseline.c.
Signed-off-by: lixiang_yewu <lixiang_yewu@cmss.chinamobile.com>
update src/common/dim_baseline.c.
Signed-off-by: lixiang_yewu <lixiang_yewu@cmss.chinamobile.com>
---
src/common/dim_baseline.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/common/dim_baseline.c b/src/common/dim_baseline.c
index 6369d7b..4733705 100644
--- a/src/common/dim_baseline.c
+++ b/src/common/dim_baseline.c
@@ -104,7 +104,8 @@ int dim_baseline_add(struct dim_baseline_tree *root, const char *name,
if (ret < 0)
goto err;
- strcpy((char *)baseline->name, name);
+ strncpy((char *)baseline->name, name, buf_len - 1);
+ baseline->name[buf_len - 1] = '\0';
write_lock(&root->lock);
ret = dim_baseline_rb_add(&root->rb_root, baseline, NULL);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinlun123123/dim_9.git
git@gitee.com:jinlun123123/dim_9.git
jinlun123123
dim_9
dim_9
master

搜索帮助