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

32 lines
1.1 KiB
Plaintext

$OpenBSD: patch-src_bnr_c,v 1.1 2005/10/26 06:18:38 jakob Exp $
--- src/bnr.c.orig Sat Sep 24 19:49:48 2005
+++ src/bnr.c Mon Oct 17 14:48:42 2005
@@ -137,11 +137,11 @@ int bnr_instantiate(BNR_CTX *BTX) {
}
previous_bnr_probs[BNR_SIZE-1] = _bnr_round(node_list->value);
- sprintf(bnr_token, "bnr.%c|", BTX->identifier);
+ snprintf(bnr_token, sizeof (bnr_token), "bnr.%c|", BTX->identifier);
for(i=0;i<BNR_SIZE;i++) {
char x[6];
snprintf(x, 6, "%01.2f_", previous_bnr_probs[i]);
- strcat(bnr_token, x);
+ strlcat(bnr_token, x, sizeof (bnr_token));
}
#ifdef LIBBNR_VERBOSE_DEBUG
@@ -280,11 +280,11 @@ int bnr_finalize(BNR_CTX *BTX) {
previous_bnr_probs[BNR_SIZE-1] = _bnr_round(node_list->value);
previous_bnr_tokens[BNR_SIZE-1] = node_list;
- sprintf(bnr_token, "bnr.%c|", BTX->identifier);
+ snprintf(bnr_token, sizeof (bnr_token), "bnr.%c|", BTX->identifier);
for(i=0;i<BNR_SIZE;i++) {
char x[6];
snprintf(x, 6, "%01.2f_", previous_bnr_probs[i]);
- strcat(bnr_token, x);
+ strlcat(bnr_token, x, sizeof (bnr_token));
}
/* Identify interesting patterns */