diff options
author | Tomas Hozza <thozza@redhat.com> | 2013-05-22 08:54:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-03 17:13:09 -0400 |
commit | f14e600a3bb62905fe9e4e0350048af4ead54ca9 (patch) | |
tree | 0ebf7bb75a606409ea8967a42302107020cbdcbe /tools/hv | |
parent | 4d81e3074423d1bd69a29d5795ff71205814d9e1 (diff) |
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>
Diffstat (limited to 'tools/hv')
-rw-r--r-- | tools/hv/hv_kvp_daemon.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c index 81cbb6ecce89..5b8f28f2aafa 100644 --- a/tools/hv/hv_kvp_daemon.c +++ b/tools/hv/hv_kvp_daemon.c | |||
@@ -765,7 +765,9 @@ static void kvp_process_ipconfig_file(char *cmd, | |||
765 | break; | 765 | break; |
766 | 766 | ||
767 | x = strchr(p, '\n'); | 767 | x = strchr(p, '\n'); |
768 | *x = '\0'; | 768 | if (x) |
769 | *x = '\0'; | ||
770 | |||
769 | strcat(config_buf, p); | 771 | strcat(config_buf, p); |
770 | strcat(config_buf, ";"); | 772 | strcat(config_buf, ";"); |
771 | } | 773 | } |