openbsd-ports/mail/dspam/patches/patch-src_dspam_c
todd 0ae9789410 update to 3.6.8, from Frank Denis
- fixes the PostgreSQL backend that failed to connect
- allows clients to link against libdspam when LDAP is turned on
2006-06-08 14:41:08 +00:00

62 lines
2.0 KiB
Plaintext

$OpenBSD: patch-src_dspam_c,v 1.7 2006/06/08 14:41:08 todd Exp $
--- src/dspam.c.orig Tue May 30 17:03:55 2006
+++ src/dspam.c Wed Jun 7 13:36:39 2006
@@ -387,7 +387,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;
}
}
@@ -400,7 +400,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;
}
@@ -420,7 +420,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;
}
}
@@ -751,10 +751,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;
}
@@ -1019,7 +1019,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)
{
@@ -1593,7 +1593,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);