Skip to content
Snippets Groups Projects
Commit bff956a1 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix host name or IP address-based smtpspy.txt logging

Caught by Coverity-scan (use of uninitialized variable, 'str') :-)
parent c0f42027
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -3156,9 +3156,10 @@ static void smtp_thread(void* arg) ...@@ -3156,9 +3156,10 @@ static void smtp_thread(void* arg)
if(trashcan(&scfg,host_name,"smtpspy") if(trashcan(&scfg,host_name,"smtpspy")
|| trashcan(&scfg,host_ip,"smtpspy")) { || trashcan(&scfg,host_ip,"smtpspy")) {
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, client.protocol); SAFECOPY(str, client.protocol);
strlwr(str); strlwr(str);
spy=fopen(str,"a"); SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, str);
spy=fopen(path,"a");
} }
/* Initialize client display */ /* Initialize client display */
...@@ -4573,8 +4574,9 @@ static void smtp_thread(void* arg) ...@@ -4573,8 +4574,9 @@ static void smtp_thread(void* arg)
if(spy==NULL if(spy==NULL
&& (trashcan(&scfg,reverse_path,"smtpspy") && (trashcan(&scfg,reverse_path,"smtpspy")
|| trashcan(&scfg,rcpt_addr,"smtpspy"))) { || trashcan(&scfg,rcpt_addr,"smtpspy"))) {
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, client.protocol); SAFECOPY(str, client.protocol);
strlwr(path); strlwr(str);
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, str);
spy=fopen(path,"a"); spy=fopen(path,"a");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment