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

p2putil: Ensure non-negative index in p2p_get_random_string

This commit is contained in:
Andrew Zaborowski 2021-06-04 03:50:42 +02:00 committed by Denis Kenzior
parent d96f542951
commit 69d9a07e34

View File

@ -2637,7 +2637,7 @@ void p2p_get_random_string(char *buf, size_t len)
l_getrandom(buf, len);
while (len) {
int index = *buf % set_size;
int index = (uint8_t) *buf % set_size;
*buf++ = CHARSET[index];
len--;