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
1 changed files with 1 additions and 1 deletions

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--;