From: Andrey Volk Date: Fri, 7 Jun 2024 11:55:10 +0000 (+0300) Subject: [Core] switch_core_port_allocator_request_port: Coverity 1227622 Calling risky function X-Git-Tag: v1.10.12^2~4^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9d379b707171b212dcc7d4b0f9db860719eeefa4;p=thirdparty%2Ffreeswitch.git [Core] switch_core_port_allocator_request_port: Coverity 1227622 Calling risky function --- diff --git a/src/switch_core_port_allocator.c b/src/switch_core_port_allocator.c index 074ce5f5ea..2ed956c6fb 100644 --- a/src/switch_core_port_allocator.c +++ b/src/switch_core_port_allocator.c @@ -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) {