openbsd-ports/mail/dspam/patches/patch-src_dspam_c

62 lines
2.0 KiB
Plaintext

$OpenBSD: patch-src_dspam_c,v 1.3 2006/01/22 04:10:43 brad Exp $
--- src/dspam.c.orig Wed Jan 18 11:48:53 2006
+++ src/dspam.c Sat Jan 21 22:54:41 2006
@@ -382,7 +382,7 @@ process_message (
CTX->confidence = 1.0;
STATUS("A virus was detected in the message contents");
result = DSR_ISSPAM;
- strcpy(CTX->class, LANG_CLASS_VIRUS);
+ strlcpy(CTX->class, LANG_CLASS_VIRUS, sizeof (CTX->class));
internally_canned = 1;
}
}
@@ -395,7 +395,7 @@ process_message (
result = DSR_ISSPAM;
CTX->probability = 1.0;
CTX->confidence = 1.0;
- strcpy(CTX->class, LANG_CLASS_BLOCKLISTED);
+ strlcpy(CTX->class, LANG_CLASS_BLOCKLISTED, sizeof (CTX->class));
internally_canned = 1;
}
@@ -415,7 +415,7 @@ process_message (
result = DSR_ISSPAM;
CTX->probability = 1.0;
CTX->confidence = 1.0;
- strcpy(CTX->class, LANG_CLASS_BLACKLISTED);
+ strlcpy(CTX->class, LANG_CLASS_BLACKLISTED, sizeof (CTX->class));
internally_canned = 1;
}
}
@@ -762,10 +762,10 @@ process_message (
switch (CTX->result) {
case DSR_ISSPAM:
- strcpy(data, "Spam");
+ strlcpy(data, "Spam", sizeof (data));
break;
default:
- strcpy(data, "Innocent");
+ strlcpy(data, "Innocent", sizeof (data));
break;
}
@@ -1030,7 +1030,7 @@ int tag_message(AGENT_CTX *ATX, ds_messa
int tagged = 0;
char spam_subject[16];
- strcpy(spam_subject, "[SPAM]");
+ strlcpy(spam_subject, "[SPAM]", sizeof (spam_subject));
if (_ds_pref_val(ATX->PTX, "spamSubject")[0] != '\n' &&
_ds_pref_val(ATX->PTX, "spamSubject")[0] != 0)
{
@@ -1595,7 +1595,7 @@ int process_users(AGENT_CTX *ATX, buffer
if (parse_message == NULL) {
LOG(LOG_CRIT, ERR_MEM_ALLOC);
presult->exitcode = ERC_PROCESS;
- strcpy(presult->text, ERR_MEM_ALLOC);
+ strlcpy(presult->text, ERR_MEM_ALLOC, sizeof (presult->text));
if (ATX->results)
nt_add(ATX->results, presult);