Fixes SplitPath which read off the end of the string. r=timeless sr=me b=245516

This commit is contained in:
dougt%meer.net 2004-06-08 05:03:59 +00:00
parent 810e7c8c3a
commit 59cdf66913

View File

@ -155,11 +155,11 @@ static PRInt32 SplitPath(PRUnichar *path, PRUnichar **nodeArray, PRInt32 arrayLe
for (PRUnichar *cp = path; *cp != 0; cp++) {
if (*cp == kPathSeparatorChar) {
*cp++ = 0;
if (*cp != 0) {
if (nodePtr - nodeArray >= arrayLen)
return -1;
*nodePtr++ = cp;
}
if (*cp == 0)
break;
if (nodePtr - nodeArray >= arrayLen)
return -1;
*nodePtr++ = cp;
}
}
return nodePtr - nodeArray;