Skip to content

Commit

Permalink
Merge pull request #2554 from signalwire/allocator
Browse files Browse the repository at this point in the history
[Core] switch_core_port_allocator_request_port: Coverity 1227622 Calling risky function
  • Loading branch information
andywolk authored Jul 30, 2024
2 parents 060621e + 9d379b7 commit 681dfee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/switch_core_port_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 681dfee

Please sign in to comment.