Skip to content

Commit

Permalink
Merge pull request #2555 from signalwire/stun
Browse files Browse the repository at this point in the history
[Core] switch_stun_random_string: Coverity 1227623 Calling risky function
  • Loading branch information
andywolk authored Jul 30, 2024
2 parents 681dfee + c736458 commit 8e3d398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/switch_stun.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down

0 comments on commit 8e3d398

Please sign in to comment.