bug 264917: crash trying to view-source. sr=bzbarsky r=doronr

git-svn-id: svn://10.0.0.236/trunk@163977 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2004-10-18 20:57:24 +00:00
parent 8c242cc3fc
commit 14c394407b

View File

@@ -997,8 +997,8 @@ nsresult CViewSourceHTML::WriteTag(PRInt32 aTagType,const nsAString & aText,PRIn
return NS_ERROR_FAILURE;
if (kBeforeText[aTagType][0] != 0) {
theContext.mITextToken.SetIndirectString(
NS_ConvertASCIItoUTF16(kBeforeText[aTagType]));
NS_ConvertASCIItoUTF16 beforeText(kBeforeText[aTagType]);
theContext.mITextToken.SetIndirectString(beforeText);
nsCParserNode theNode(&theContext.mITextToken, 0/*stack token*/);
mSink->AddLeaf(theNode);
}
@@ -1054,8 +1054,8 @@ nsresult CViewSourceHTML::WriteTag(PRInt32 aTagType,const nsAString & aText,PRIn
// Tokens are set in error if their ending > is not there, so don't output
// the after-text
if (!aTagInError && kAfterText[aTagType][0] != 0) {
theContext.mITextToken.SetIndirectString(
NS_ConvertASCIItoUTF16(kAfterText[aTagType]));
NS_ConvertASCIItoUTF16 afterText(kAfterText[aTagType]);
theContext.mITextToken.SetIndirectString(afterText);
nsCParserNode theNode(&theContext.mITextToken, 0/*stack token*/);
mSink->AddLeaf(theNode);
}