Commit f14e600a authored by Tomas Hozza's avatar Tomas Hozza Committed by 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: default avatarTomas Hozza <thozza@redhat.com>
Acked-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment