未验证 提交 c06d737e 编写于 作者: O openharmony_ci 提交者: Gitee

!261 fix bugs of use uninitialized mem in dlns_create

Merge pull request !261 from hhj/mem-release31
...@@ -2456,10 +2456,10 @@ int dlns_create(Dl_namespace *ns,const char *search_path) ...@@ -2456,10 +2456,10 @@ int dlns_create(Dl_namespace *ns,const char *search_path)
sys_length += search_length; sys_length += search_length;
} }
new_path = malloc(sys_length + 1); new_path = (char *)malloc(sys_length + 1);
if (!new_path) return ENOMEM; if (!new_path) return ENOMEM;
strcat(new_path, sys_path); strcpy(new_path, sys_path);
if (search_path[0] != ':') { if (search_path[0] != ':') {
strcat(new_path, ":"); strcat(new_path, ":");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册