- fix the pointer position update error after enviroment variable is replaced. - ignore the rule when the environment in %E(env) isn't found. Signed-off-by: tangjie02 <tangjie02@kylinsec.com.cn>
32 lines
849 B
Diff
32 lines
849 B
Diff
From f0d6941ba9ea9044237a4eb350a92bc5fa72e07a Mon Sep 17 00:00:00 2001
|
|
From: tangjie02 <tangjie02@kylinos.com.cn>
|
|
Date: Fri, 14 May 2021 18:58:25 +0800
|
|
Subject: [PATCH 1/2] fix(env): Fix the pointer position update error after
|
|
enviroment variable is replaced.
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
- 修复环境变量替换后指针计算错误问题
|
|
|
|
Signed-off-by: tangjie02 <tangjie02@kylinos.com.cn>
|
|
---
|
|
src/zc_util.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/src/zc_util.c b/src/zc_util.c
|
|
index 93745ae..b5ee1c2 100644
|
|
--- a/src/zc_util.c
|
|
+++ b/src/zc_util.c
|
|
@@ -144,6 +144,7 @@ int zc_str_replace_env(char *str, size_t str_size)
|
|
|
|
memmove(p + env_value_len, q, strlen(q) + 1);
|
|
memcpy(p, env_value, env_value_len);
|
|
+ q = p + env_value_len;
|
|
|
|
} while (1);
|
|
|
|
--
|
|
2.27.0
|
|
|