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 <ayala.beker@intel.com>
This commit is contained in:
Ayala Beker 2015-12-10 12:56:03 +02:00 committed by Jouni Malinen
parent 1b3dd69d93
commit 819ad5b70b

View 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;
}