From bae1345b9d7fab29e4db6f59b2e22e77bac41f8b Mon Sep 17 00:00:00 2001 From: Pav Lucistnik Date: Sat, 12 May 2007 13:36:13 +0000 Subject: [PATCH] Fix crash when using 'du' capability: NULL return of strpbrk was not handled PR: bin/108368 Reported by: Ivo Hazmuk Submitted by: rdivacky MFC after: 2 weeks --- usr.bin/tip/tip/acu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/tip/tip/acu.c b/usr.bin/tip/tip/acu.c index efd8ca14461..78786981f11 100644 --- a/usr.bin/tip/tip/acu.c +++ b/usr.bin/tip/tip/acu.c @@ -100,10 +100,10 @@ con(void) if ((acu = acutype(AT)) == NOACU) return ("unknown ACU type"); if (*cp != '@') { - while (*cp) { + while (cp != NULL && *cp) { phnum = cp; cp = strpbrk(cp, ","); - if (*cp != '\0') + if (cp != NULL && *cp != '\0') *cp++ = '\0'; if (strlen(phnum) == 0)