瀏覽代碼

[Core] switch_core_port_allocator_request_port: Coverity 1227622 Calling risky function

Andrey Volk 5 月之前
父節點
當前提交
9d379b7071
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/switch_core_port_allocator.c

+ 1 - 1
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) {