From 96827d8003a247b46026c5b0889dfd65a6571c0b Mon Sep 17 00:00:00 2001 From: "vidur%netscape.com" Date: Thu, 3 Feb 2000 00:11:16 +0000 Subject: [PATCH] Fix for bug 26236. Unescaping can change the length of the string. We now use the length of the unescaped string. Removed unnecessary null check. r=ftang git-svn-id: svn://10.0.0.236/trunk@59575 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/dom/src/base/nsGlobalWindow.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 192b37a53c8..f34735ab954 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -1627,13 +1627,9 @@ GlobalWindowImpl::Unescape(const nsString& aStr, nsString& aReturn) // Unescape the string char* src = nsUnescape(inBuf); -// nsAllocator::Free(inBuf); - if (nsnull == src) { - return NS_ERROR_OUT_OF_MEMORY; - } PRInt32 maxLength, srcLen; - srcLen = aStr.Length(); + srcLen = nsCRT::strlen(src); // Get the expected length of the result string result = decoder->GetMaxLength(src, srcLen, &maxLength);