Fixing bug 245930. Don't crash if attempting to replace data past the end of a string. r=dbaron@dbaron.org, sr=darin@meer.net

git-svn-id: svn://10.0.0.236/trunk@157612 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%mozilla.jstenback.com
2004-06-08 22:30:11 +00:00
parent 87a26c000f
commit 21648d2224

View File

@@ -426,6 +426,8 @@ nsTSubstring_CharT::Replace( index_type cutStart, size_type cutLength, const cha
}
}
cutStart = PR_MIN(cutStart, Length());
ReplacePrep(cutStart, cutLength, length);
if (length > 0)
@@ -449,6 +451,8 @@ nsTSubstring_CharT::ReplaceASCII( index_type cutStart, size_type cutLength, cons
}
#endif
cutStart = PR_MIN(cutStart, Length());
ReplacePrep(cutStart, cutLength, length);
if (length > 0)
@@ -467,6 +471,8 @@ nsTSubstring_CharT::Replace( index_type cutStart, size_type cutLength, const sub
size_type length = tuple.Length();
cutStart = PR_MIN(cutStart, Length());
ReplacePrep(cutStart, cutLength, length);
if (length > 0)