mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 08:15:31 +00:00
nsXMLContentSerializer::AppendTextData() causes assertion in nsDependentString::Rebind()
bug 119335 r=akkana sr=jst a=asa patch=tmutreja@netscape.com
This commit is contained in:
parent
6edffd5f4d
commit
27d5bba4cc
@ -104,11 +104,13 @@ nsXMLContentSerializer::AppendTextData(nsIDOMNode* aNode,
|
||||
content->GetText(&frag);
|
||||
|
||||
if (frag) {
|
||||
PRInt32 length = ((aEndOffset == -1) ? frag->GetLength() : aEndOffset) - aStartOffset;
|
||||
PRInt32 endoffset = (aEndOffset == -1) ? frag->GetLength() : aEndOffset;
|
||||
PRInt32 length = endoffset - aStartOffset;
|
||||
|
||||
NS_ASSERTION(aStartOffset >= 0, "Negative start offset for text fragment!");
|
||||
NS_ASSERTION(aStartOffset <= endoffset, "A start offset is beyond the end of the text fragment!");
|
||||
|
||||
if (length <= 0) {
|
||||
NS_ASSERTION(aStartOffset == 0,
|
||||
"a start offset is beyond the end of the text fragment!");
|
||||
return NS_OK; // XXX Zero is a legal value, maybe non-zero values should
|
||||
// be an error.
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user