Skip to content

Commit

Permalink
[Core] switch_simple_email: Coverity 1227612 Calling risky function
Browse files Browse the repository at this point in the history
  • Loading branch information
andywolk committed Jul 30, 2024
1 parent 85397f1 commit 0974bd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/switch_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0974bd1

Please sign in to comment.