3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

sae: Fix potential leak in sae_process_anti_clogging

We may receive multiple anti-clogging request messages.  We memdup the
token every time, without checking whether memory for one has already
been allocated.  Free the old token prior to allocating a new one.
This commit is contained in:
Denis Kenzior 2021-07-09 23:30:11 -05:00
parent 67be05ec3e
commit c02b1466c4

View File

@ -898,6 +898,7 @@ static int sae_process_anti_clogging(struct sae_sm *sm, const uint8_t *ptr,
return -EBADMSG;
}
l_free(sm->token);
sm->token = l_memdup(ptr, len);
sm->token_len = len;
sm->sync = 0;