From: Andrey Volk Date: Fri, 7 Jun 2024 11:56:56 +0000 (+0300) Subject: [Core] switch_stun_random_string: Coverity 1227623 Calling risky function X-Git-Tag: v1.10.12^2~3^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F2555%2Fhead;p=thirdparty%2Ffreeswitch.git [Core] switch_stun_random_string: Coverity 1227623 Calling risky function --- diff --git a/src/switch_stun.c b/src/switch_stun.c index 2ab1f41d5a..d58dd6fd93 100644 --- a/src/switch_stun.c +++ b/src/switch_stun.c @@ -135,7 +135,7 @@ SWITCH_DECLARE(void) switch_stun_random_string(char *buf, uint16_t len, char *se max = (int) strlen(set); for (x = 0; x < len; x++) { - int j = (int) (max * 1.0 * rand() / (RAND_MAX + 1.0)); + int j = (int) (max * 1.0 * switch_rand() / (SWITCH_RAND_MAX + 1.0)); buf[x] = set[j]; } }