dot11decrypt: explicitly cast *pmk_len and msk_len
In a typical setting where int is 32 bits and the type guint8 is 8 bits, the overflow check in Dot11DecryptDerivePmkFromMsk will automatically promote the sum of msk_len and *pmk_len to an int. Since int is 32 bits and guint8 will always be 8 bits, the sum will never overflow. Therefore, an explicit casting of the sum of msk_len and *pmk_len to the type guint8 is necessary. Signed-off-by: Elijah Conners <business@elijahpepe.com>
This commit is contained in:
parent
8fd9d1d274
commit
f72a33fc1c
|
@ -1531,7 +1531,7 @@ Dot11DecryptDerivePmkFromMsk(const guint8 *msk, guint8 msk_len, int akm,
|
|||
} else {
|
||||
*pmk_len = 256 / 8;
|
||||
}
|
||||
if (msk_len + *pmk_len < msk_len) {
|
||||
if ((guint8)(msk_len + *pmk_len) < msk_len) {
|
||||
*pmk_len = 0;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue