提交 f14e600a 编写于 作者: T Tomas Hozza 提交者: Greg Kroah-Hartman

tools: hv: Check retrun value of strchr call

Check return value of strchr call and dereference it only if it is
not NULL.
Signed-off-by: NTomas Hozza <thozza@redhat.com>
Acked-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 4d81e307
......@@ -765,7 +765,9 @@ static void kvp_process_ipconfig_file(char *cmd,
break;
x = strchr(p, '\n');
*x = '\0';
if (x)
*x = '\0';
strcat(config_buf, p);
strcat(config_buf, ";");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册