]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
utils: Fix NULL pointer dereference with unexpected kernel behavior
authorAyala Beker <ayala.beker@intel.com>
Thu, 10 Dec 2015 10:56:03 +0000 (12:56 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 17 Dec 2015 22:24:52 +0000 (00:24 +0200)
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 <ayala.beker@intel.com>
src/utils/wpa_debug.c

index 3275524f641db2acfe2b1116dd97fc46d0c9454b..f7acf6b9f6984b528296d0708a74f240ba85fc38 100644 (file)
@@ -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;
                }