]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] switch_core_port_allocator_request_port: Coverity 1227622 Calling risky function 2554/head
authorAndrey Volk <andywolk@gmail.com>
Fri, 7 Jun 2024 11:55:10 +0000 (14:55 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 30 Jul 2024 16:24:13 +0000 (19:24 +0300)
src/switch_core_port_allocator.c

index 074ce5f5ea5f717d904983edbe8378510b28e7fc..2ed956c6fbd52d4a8f8ffcb30db2b6d65b7fd58e 100644 (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) {