mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-09 16:57:36 +00:00
Fixes SplitPath which read off the end of the string. r=timeless sr=me b=245516
This commit is contained in:
parent
810e7c8c3a
commit
59cdf66913
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user