summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2007-05-12 21:20:41 +0000
committerRay Lai <ray@cvs.openbsd.org>2007-05-12 21:20:41 +0000
commitce4eea266def4c3fbdbda2eee8f79d24d82c5416 (patch)
tree003c827b3b8bcc123a6d552662489a9ac5d3df50 /usr.bin
parent2d53e75cf5199a1b3879c54ce8400ecf9eb9be82 (diff)
Prevent core dump if strpbrk() returns NULL. Reported to bugs@ by
Pav Lucistnik <pav at FreeBSD>, thanks! OK otto@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tip/acu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/tip/acu.c b/usr.bin/tip/acu.c
index 85b5e4ac30a..d116e83c0fe 100644
--- a/usr.bin/tip/acu.c
+++ b/usr.bin/tip/acu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acu.c,v 1.13 2006/10/18 21:18:59 deraadt Exp $ */
+/* $OpenBSD: acu.c,v 1.14 2007/05/12 21:20:40 ray Exp $ */
/* $NetBSD: acu.c,v 1.4 1996/12/29 10:34:03 cgd Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)acu.c 8.1 (Berkeley) 6/6/93";
#endif
-static const char rcsid[] = "$OpenBSD: acu.c,v 1.13 2006/10/18 21:18:59 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: acu.c,v 1.14 2007/05/12 21:20:40 ray Exp $";
#endif /* not lint */
#include "tip.h"
@@ -99,7 +99,7 @@ con(void)
if (*cp != '@') {
while (*cp) {
phnum = cp;
- cp = strpbrk(cp, ",");
+ cp += strcspn(cp, ",");
if (*cp != '\0')
*cp++ = '\0';