commit 69d9a07e34cc6c41845cc0f7972c83f12168bfd9
parent d96f542951407711a1edc77de92ca7a3dfc0ebf8
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Fri, 4 Jun 2021 03:50:42 +0200
p2putil: Ensure non-negative index in p2p_get_random_string
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/p2putil.c b/src/p2putil.c
@@ -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--;