3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 04:32:37 +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;
case 'g':
gdb_opt = optarg;
if (!(!strcmp(gdb_opt, "iwd") ||
!strcmp(gdb_opt, "hostapd") ||
!strcmp(gdb_opt, "hwsim"))) {
if (!gdb_opt || (strcmp(gdb_opt, "iwd") &&
strcmp(gdb_opt, "hostapd") &&
strcmp(gdb_opt, "hwsim"))) {
l_error("--gdb can only be used with iwd"
", hwsim or hostapd");
return EXIT_FAILURE;