Sfoglia il codice sorgente

[Core] switch_stun_random_string: Coverity 1227623 Calling risky function

Andrey Volk 5 mesi fa
parent
commit
c736458a21
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      src/switch_stun.c

+ 1 - 1
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];
 	}
 }