summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2003-05-16 22:30:16 +0000
committerBob Beck <beck@cvs.openbsd.org>2003-05-16 22:30:16 +0000
commitab44b5cefb4c7bf25cf6bc3e01d4aaf02b688297 (patch)
treece43f076fcdc0fb0b3083a85e014b985c10b2c49 /libexec
parent19e276abf68ccb0e5f1198c5bdd2a31fcb823809 (diff)
This was using the wrong buffer, and wrong lengths. fix it from me and
tedu, ok tedu@
Diffstat (limited to 'libexec')
-rw-r--r--libexec/spamd/spamd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libexec/spamd/spamd.c b/libexec/spamd/spamd.c
index dfbc19c3c2a..37ae586a408 100644
--- a/libexec/spamd/spamd.c
+++ b/libexec/spamd/spamd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spamd.c,v 1.32 2003/04/15 07:16:14 deraadt Exp $ */
+/* $OpenBSD: spamd.c,v 1.33 2003/05/16 22:30:15 beck Exp $ */
/*
* Copyright (c) 2002 Theo de Raadt. All rights reserved.
@@ -655,7 +655,7 @@ void
handler(struct con *cp)
{
int end = 0;
- int i, n;
+ int n;
if (cp->r) {
n = read(cp->fd, cp->ip, cp->il);
@@ -666,10 +666,10 @@ handler(struct con *cp)
perror("read()");
closecon(cp);
} else {
+ cp->ip[n] = '\0';
if (cp->rend[0])
- for (i = 0; i < n; i++)
- if (strchr(cp->rend, cp->op[i]))
- end = 1;
+ if (strpbrk(cp->ip, cp->rend))
+ end = 1;
cp->ip += n;
cp->il -= n;
}