]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[Core] switch_simple_email: Coverity 1227612 Calling risky function 2552/head
authorAndrey Volk <andywolk@gmail.com>
Fri, 7 Jun 2024 11:52:27 +0000 (14:52 +0300)
committerAndrey Volk <andywolk@gmail.com>
Tue, 30 Jul 2024 15:32:01 +0000 (18:32 +0300)
src/switch_utils.c

index 1af2011dbd28a15ea576e601e08df9a5667c81fa..aa3fc74cae35f06935c7eea254b2a32aefe0b961 100644 (file)
@@ -1160,7 +1160,7 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
                switch_safe_free(dupfile);
        }
 
-       switch_snprintf(filename, 80, "%s%smail.%d%04x", SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, (int)(switch_time_t) switch_epoch_time_now(NULL), rand() & 0xffff);
+       switch_snprintf(filename, 80, "%s%smail.%d%04x", SWITCH_GLOBAL_dirs.temp_dir, SWITCH_PATH_SEPARATOR, (int)(switch_time_t) switch_epoch_time_now(NULL), switch_rand() & 0xffff);
 
        if ((fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644)) > -1) {
                if (file) {