Merge pull request #2554 from signalwire/allocator

[Core] switch_core_port_allocator_request_port: Coverity 1227622 Calling risky function
This commit is contained in:
Andrey Volk 2024-07-30 20:03:54 +03:00 committed by GitHub
commit 681dfee13d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_port_allocator_request_port(switch_c
uint32_t tries = 0;
/* randomly pick a port */
index = rand() % alloc->track_len;
index = switch_rand() % alloc->track_len;
/* if it is used walk up the list to find a free one */
while (alloc->track[index] && tries < alloc->track_len) {