Raptor only. Fix crasher.

git-svn-id: svn://10.0.0.236/trunk@11265 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
valeski%netscape.com
1998-09-28 20:47:49 +00:00
parent 4cde933916
commit 62f772cb7b

View File

@@ -503,6 +503,11 @@ nsresult URLImpl::ParseURL(const nsIURL* aURL, const nsString& aSpec)
if (cSpec[0] != '\0') {
// Strip out old tail component and put in the new one
char* dp = PL_strrchr(uFile, '/');
if (!dp) {
delete cSpec;
NS_UNLOCK_INSTANCE();
return NS_ERROR_ILLEGAL_VALUE;
}
PRInt32 dirlen = (dp + 1) - uFile;
mFile = (char*) PR_Malloc(dirlen + len);
PL_strncpy(mFile, uFile, dirlen);