summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-08 22:06:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-08 22:06:03 +0000
commit2a800702cea2b140652e32376a326940d890e227 (patch)
tree253bb6bdef2f7b697d00e2bcb5f531ce88ed2036 /libexec
parent8af46aeefb0b6d526e31e1f0f9f62adf341efb37 (diff)
knf
Diffstat (limited to 'libexec')
-rw-r--r--libexec/spamd-setup/spamd-setup.c7
-rw-r--r--libexec/spamd/spamd.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/libexec/spamd-setup/spamd-setup.c b/libexec/spamd-setup/spamd-setup.c
index 94753dc527e..c4ffd69c081 100644
--- a/libexec/spamd-setup/spamd-setup.c
+++ b/libexec/spamd-setup/spamd-setup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd-setup.c,v 1.2 2003/03/08 18:29:16 deraadt Exp $ */
+/* $OpenBSD: spamd-setup.c,v 1.3 2003/03/08 22:06:02 deraadt Exp $ */
/*
* Copyright (c) 2003 Bob Beck. All rights reserved.
*
@@ -332,6 +332,7 @@ fix_quoted_colons(char *buf)
}
if (j == nbs) {
char *tmp;
+
nbs += 128;
tmp = realloc(newbuf, nbs);
if (tmp == NULL)
@@ -362,12 +363,14 @@ do_message(FILE *sdc, char *msg)
* file and read the message from it.
*/
int fd;
+
fd = open(msg, O_RDONLY);
if (fd == -1)
err(1, "Can't open message from %s", msg);
for (;;) {
if (bu == bs) {
char *tmp;
+
tmp = realloc(buf, bs + 8192);
if (tmp == NULL)
errx(1, "Malloc failed");
@@ -426,6 +429,7 @@ add_blacklist(struct bl *bl, int *blc, int *bls, int fd, int white)
/* read in fd, then parse */
if (bu == bs) {
char *tmp;
+
tmp = realloc(buf, bs + 8192);
if (tmp == NULL) {
free(buf);
@@ -513,6 +517,7 @@ collapse_blacklist(struct bl *bl, int blc)
for (i = 0; i < blc;) {
int laststate = state;
u_int32_t addr = bl[i].addr;
+
do {
bs += bl[i].b;
ws += bl[i].w;
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c
index 800c551e3dc..6753f7a81f5 100644
--- a/libexec/spamd/spamd.c
+++ b/libexec/spamd/spamd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd.c,v 1.21 2003/03/04 05:54:53 beck Exp $ */
+/* $OpenBSD: spamd.c,v 1.22 2003/03/08 22:05:20 deraadt Exp $ */
/*
* Copyright (c) 2002 Theo de Raadt. All rights reserved.
@@ -404,6 +404,7 @@ build_reply(struct con *cp)
int used = 0;
char *c = cp->obuf + off;
int left = cp->osize - off;
+
used = append_error_string(cp, off, matches[0]->string,
cp->af, cp->ia);
if (used == -1)
@@ -822,6 +823,7 @@ main(int argc, char *argv[])
struct timeval tv, *tvp;
int max, i, n;
int writers;
+
max = MAX(s, conflisten);
max = MAX(max, conffd);