From 62f772cb7b51a5863524eb11dcb219dfa182f63e Mon Sep 17 00:00:00 2001 From: "valeski%netscape.com" Date: Mon, 28 Sep 1998 20:47:49 +0000 Subject: [PATCH] Raptor only. Fix crasher. git-svn-id: svn://10.0.0.236/trunk@11265 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/network/module/nsURL.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mozilla/network/module/nsURL.cpp b/mozilla/network/module/nsURL.cpp index 71a1425597d..4f8da8c5079 100644 --- a/mozilla/network/module/nsURL.cpp +++ b/mozilla/network/module/nsURL.cpp @@ -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);