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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user