mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-06 05:02:31 +00:00
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: Tomas Hozza <thozza@redhat.com> Acked-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
4d81e30744
commit
f14e600a3b
@ -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, ";");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user