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 Lucistnik 2007-05-12 13:36:13 +00:00
parent 1cf95db60f
commit bae1345b9d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169504

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)