Commit bff956a1 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

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

Caught by Coverity-scan (use of uninitialized variable, 'str') :-)
parent c0f42027
......@@ -3156,9 +3156,10 @@ static void smtp_thread(void* arg)
if(trashcan(&scfg,host_name,"smtpspy")
|| trashcan(&scfg,host_ip,"smtpspy")) {
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, client.protocol);
SAFECOPY(str, client.protocol);
strlwr(str);
spy=fopen(str,"a");
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, str);
spy=fopen(path,"a");
}
/* Initialize client display */
......@@ -4573,8 +4574,9 @@ static void smtp_thread(void* arg)
if(spy==NULL
&& (trashcan(&scfg,reverse_path,"smtpspy")
|| trashcan(&scfg,rcpt_addr,"smtpspy"))) {
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, client.protocol);
strlwr(path);
SAFECOPY(str, client.protocol);
strlwr(str);
SAFEPRINTF2(path,"%s%sspy.txt", scfg.logs_dir, str);
spy=fopen(path,"a");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment