3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 14:49:24 +01:00

t-runner: Check for NULL before using strcmp

This commit is contained in:
Tim Kourt 2019-10-22 16:13:16 -07:00 committed by Denis Kenzior
parent e859e98869
commit e3551ab56b

View File

@ -2957,9 +2957,9 @@ int main(int argc, char *argv[])
break; break;
case 'g': case 'g':
gdb_opt = optarg; gdb_opt = optarg;
if (!(!strcmp(gdb_opt, "iwd") || if (!gdb_opt || (strcmp(gdb_opt, "iwd") &&
!strcmp(gdb_opt, "hostapd") || strcmp(gdb_opt, "hostapd") &&
!strcmp(gdb_opt, "hwsim"))) { strcmp(gdb_opt, "hwsim"))) {
l_error("--gdb can only be used with iwd" l_error("--gdb can only be used with iwd"
", hwsim or hostapd"); ", hwsim or hostapd");
return EXIT_FAILURE; return EXIT_FAILURE;