Fix crash when using 'du' capability: NULL return of strpbrk was not handled

PR:		bin/108368
Reported by:	Ivo Hazmuk <ivo@vutbr.cz>
Submitted by:	rdivacky
MFC after:	2 weeks
This commit is contained in:
pav 2007-05-12 13:36:13 +00:00
parent 36a46e2d9f
commit 15acba9364

View File

@ -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)