mirror of
https://github.com/wiire-a/pixiewps.git
synced 2025-07-27 15:54:29 +02:00
Fixed segfault when -a is not supplied
This is a quick fix. The code should be refactored and the logic adjusted.
This commit is contained in:
parent
9304e82888
commit
2c8bf618b6
@ -894,12 +894,6 @@ usage_err:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Not all required arguments have been supplied */
|
|
||||||
if (wps->pke == 0 || wps->e_hash1 == 0 || wps->e_hash2 == 0 || wps->e_nonce == 0) {
|
|
||||||
snprintf(wps->error, 256, "\n [!] Not all required arguments have been supplied!\n\n");
|
|
||||||
goto usage_err;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* If --dh-small is selected then no --pkr should be supplied */
|
/* If --dh-small is selected then no --pkr should be supplied */
|
||||||
if (wps->pkr && wps->small_dh_keys) {
|
if (wps->pkr && wps->small_dh_keys) {
|
||||||
snprintf(wps->error, 256, "\n [!] Options --dh-small and --pkr are mutually exclusive!\n\n");
|
snprintf(wps->error, 256, "\n [!] Options --dh-small and --pkr are mutually exclusive!\n\n");
|
||||||
@ -912,6 +906,14 @@ usage_err:
|
|||||||
goto usage_err;
|
goto usage_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Not all required arguments have been supplied */
|
||||||
|
if (!wps->pke || !wps->e_hash1 || !wps->e_hash2 || !wps->e_nonce ||
|
||||||
|
(!wps->authkey && !((wps->small_dh_keys || check_small_dh_keys(wps->pkr))
|
||||||
|
&& wps->e_bssid && wps->r_nonce))) {
|
||||||
|
snprintf(wps->error, 256, "\n [!] Not all required arguments have been supplied!\n\n");
|
||||||
|
goto usage_err;
|
||||||
|
}
|
||||||
|
|
||||||
/* Cannot specify --start or --end if --force is selected */
|
/* Cannot specify --start or --end if --force is selected */
|
||||||
if (wps->bruteforce && ((start_p != (time_t) -1) || (end_p != (time_t) -1))) {
|
if (wps->bruteforce && ((start_p != (time_t) -1) || (end_p != (time_t) -1))) {
|
||||||
snprintf(wps->error, 256, "\n [!] Cannot specify --start or --end if --force is selected!\n\n");
|
snprintf(wps->error, 256, "\n [!] Cannot specify --start or --end if --force is selected!\n\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user