From 251da2f905ed4585cea1e263f585a5dd9e42be05 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Fri, 7 Jun 2024 14:57:53 +0300 Subject: [PATCH] [mod_mariadb] mariadb_send_query: Coverity 1518917 Calling risky function --- src/mod/databases/mod_mariadb/mod_mariadb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mod/databases/mod_mariadb/mod_mariadb.c b/src/mod/databases/mod_mariadb/mod_mariadb.c index 09b67468bb..c39c2ce818 100644 --- a/src/mod/databases/mod_mariadb/mod_mariadb.c +++ b/src/mod/databases/mod_mariadb/mod_mariadb.c @@ -641,7 +641,7 @@ switch_status_t mariadb_send_query(mariadb_handle_t *handle, const char* sql) switch_safe_free(err_str); /* We are waiting for 500 ms and random time is not more than 500 ms. This is necessary so that the delay on the primary and secondary servers does not coincide and deadlock does not occur again. */ - switch_yield(500 + (rand() & 511)); + switch_yield(500 + (switch_rand() & 511)); goto again; }