From: Cheoleun Moon Date: Fri, 25 Sep 2020 04:13:25 +0000 (+0900) Subject: Add null check X-Git-Tag: submit/tizen/20200925.061031^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f27bcdd88aeea4599da5463d624418f2131a377;p=platform%2Fcore%2Fconnectivity%2Fnet-config.git Add null check Change-Id: I620ed7beba7b0b697f94c163642e6bb8e4bdff25 --- diff --git a/src/network-statistics.c b/src/network-statistics.c index e76bc7e..b440449 100755 --- a/src/network-statistics.c +++ b/src/network-statistics.c @@ -77,8 +77,10 @@ gboolean netconfig_wifi_get_bytes_statistics(guint64 *tx, guint64 *rx, gboolean p_ifname = buf; while (*p_ifname == ' ') p_ifname++; p_entry = strchr(p_ifname, ':'); - if (p_entry != NULL) - *p_entry++ = '\0'; + if (p_entry == NULL) + continue; + + *p_entry++ = '\0'; device_data = __find_wifi_interface_name(p_ifname); if (device_data == NULL)