Skip to content

Commit

Permalink
fix segfault in -7 mode
Browse files Browse the repository at this point in the history
regression since ef4eaff
found by @binarymaster
  • Loading branch information
rofl0r authored and wiire-a committed Dec 4, 2017
1 parent cb38f8f commit ef28cc6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pixiewps.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,10 @@ int main(int argc, char **argv)
wps->e_s2 = malloc(WPS_SECRET_NONCE_LEN); if (!wps->e_s2) goto memory_err;
wps->psk1 = malloc(WPS_HASH_LEN); if (!wps->psk1) goto memory_err;
wps->psk2 = malloc(WPS_HASH_LEN); if (!wps->psk2) goto memory_err;
wps->empty_psk = malloc(WPS_HASH_LEN); if (!wps->empty_psk) goto memory_err;

empty_pin_hmac(wps);

if ((vtag = find_vtag(decrypted5, wps->m5_encr_len - 16, WPS_TAG_E_SNONCE_1, WPS_NONCE_LEN))) {
memcpy(wps->e_s1, vtag->data, WPS_NONCE_LEN);
}
Expand Down Expand Up @@ -814,6 +818,7 @@ int main(int argc, char **argv)
free(wps->e_s2);
free(wps->psk1);
free(wps->psk2);
free(wps->empty_psk);
}
}

Expand Down

0 comments on commit ef28cc6

Please sign in to comment.