]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_mariadb] mariadb_send_query: Coverity 1518917 Calling risky function 2556/head
authorAndrey Volk <andywolk@gmail.com>
Fri, 7 Jun 2024 11:57:53 +0000 (14:57 +0300)
committerAndrey Volk <andywolk@gmail.com>
Wed, 31 Jul 2024 13:04:38 +0000 (16:04 +0300)
src/mod/databases/mod_mariadb/mod_mariadb.c

index 09b67468bb3311dbaa01278fa143ce00c7549360..c39c2ce8188c8e1a67aac534b83cdf48cb05f812 100644 (file)
@@ -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;
                        }