mirror of
https://github.com/wiire-a/pixiewps.git
synced 2025-07-28 16:24:55 +02:00
Fixed potential integer overflow
The variable 'i' was of type uint_fast8_t which most compiler typedef as unsigned char or uint8_t which both (in C99) can hold a number between 0 and 255. This could cause an integer overflow when seed was found in mode 3 but the the program was unsuccessful to recover the PIN within the first 255 tries of the first time window set in the future. This bug was introduced when the constant MODE3_TRIES was increased to 10 minutes (60 * 10 = 600 which is > 255) in commit (d3e4aab).
This commit is contained in:
parent
0b56be18c7
commit
81301b7e71
@ -901,7 +901,7 @@ usage_err:
|
|||||||
|
|
||||||
if (nonce_seed) { /* Seed found */
|
if (nonce_seed) { /* Seed found */
|
||||||
int32_t res;
|
int32_t res;
|
||||||
uint_fast8_t i = 0;
|
int i = 0; /* Must hold MODE3_TRIES */
|
||||||
uint8_t tmp_s_nonce[16];
|
uint8_t tmp_s_nonce[16];
|
||||||
|
|
||||||
DEBUG_PRINT("Trying forward in time");
|
DEBUG_PRINT("Trying forward in time");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user