]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] switch_stun_random_string: Coverity 1227623 Calling risky function 2555/head
authorAndrey Volk <andywolk@gmail.com>
Fri, 7 Jun 2024 11:56:56 +0000 (14:56 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 30 Jul 2024 16:32:28 +0000 (19:32 +0300)
src/switch_stun.c

index 2ab1f41d5a1210dffd7e32f22de09c3e2a806082..d58dd6fd93db5f2c0af9ce91fac6f64182a19ee2 100644 (file)
@@ -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];
        }
 }