From 4f27bcdd88aeea4599da5463d624418f2131a377 Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Fri, 25 Sep 2020 13:13:25 +0900 Subject: [PATCH] Add null check Change-Id: I620ed7beba7b0b697f94c163642e6bb8e4bdff25 --- src/network-statistics.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) -- 2.7.4