Browse Source

[mod_mariadb] mariadb_send_query: Coverity 1518917 Calling risky function

Andrey Volk 5 months ago
parent
commit
251da2f905
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/mod/databases/mod_mariadb/mod_mariadb.c

+ 1 - 1
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);
 				switch_safe_free(err_str);
 				/* We are waiting for 500 ms and random time is not more than 500 ms.
 				/* 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. */
 				  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;
 				goto again;
 			}
 			}