From: Ayala Beker Date: Thu, 10 Dec 2015 10:56:03 +0000 (+0200) Subject: utils: Fix NULL pointer dereference with unexpected kernel behavior X-Git-Tag: hostap_2_6~1179 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=819ad5b70b0cb2d3ed64c11aa4cbf11c9a3fc698;p=thirdparty%2Fhostap.git utils: Fix NULL pointer dereference with unexpected kernel behavior Fix mostly theoretical NULL pointer dereference in wpa_debug_open_linux_tracing() if /proc/mounts were to return a malformed line. Signed-off-by: Ayala Beker --- diff --git a/src/utils/wpa_debug.c b/src/utils/wpa_debug.c index 3275524f6..f7acf6b9f 100644 --- a/src/utils/wpa_debug.c +++ b/src/utils/wpa_debug.c @@ -148,7 +148,7 @@ int wpa_debug_open_linux_tracing(void) strtok_r(line, " ", &tmp2); tmp_path = strtok_r(NULL, " ", &tmp2); fstype = strtok_r(NULL, " ", &tmp2); - if (strcmp(fstype, "debugfs") == 0) { + if (fstype && strcmp(fstype, "debugfs") == 0) { path = tmp_path; break; }