Closed Bug 620394 Opened 14 years ago Closed 14 years ago

crash [@ PresShell::GoToAnchor] if selectAnchor && xpointerResult && !sel

Categories

(Core :: Layout, defect)

defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla2.0b9

People

(Reporter: timeless, Assigned: timeless)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, crash)

Crash Data

Attachments

(1 file)

3772 PresShell::GoToAnchor(const nsAString& aAnchorName, PRBool aScroll) 3852 nsCOMPtr<nsIDOMRange> jumpToRange; 3853 nsCOMPtr<nsIXPointerResult> xpointerResult; 3854 if (!content) { 3855 nsCOMPtr<nsIDOMXMLDocument> xmldoc = do_QueryInterface(mDocument); 3856 if (xmldoc) { 3858 xmldoc->EvaluateXPointer(aAnchorName, getter_AddRefs(xpointerResult)); 3859 if (xpointerResult) { 3860 xpointerResult->Item(0, getter_AddRefs(jumpToRange)); 3867 } 3920 } 3921 } 3929 if (content) { 3945 PRBool selectAnchor = nsContentUtils::GetBoolPref("layout.selectanchor"); 3950 if (!jumpToRange) { 3951 jumpToRange = do_CreateInstance(kRangeCID); 3960 } 3961 if (jumpToRange) { 3963 nsISelection* sel = mSelection-> 3964 GetSelection(nsISelectionController::SELECTION_NORMAL); null check: 3965 if (sel) { 3966 sel->RemoveAllRanges(); 3968 if (!selectAnchor) { 3969 // Use a caret (collapsed selection) at the start of the anchor 3970 sel->CollapseToStart(); 3971 } 3972 } 3973 3974 if (selectAnchor && xpointerResult) { 3977 xpointerResult->GetLength(&count); 3978 for (i = 1; i < count; i++) { // jumpToRange is i = 0 3979 nsCOMPtr<nsIDOMRange> range; 3980 xpointerResult->Item(i, getter_AddRefs(range)); crash: 3981 sel->AddRange(range); 3982 } 3983 }
Attached patch proposal (deleted) — Splinter Review
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #498882 - Flags: review?(roc)
Attachment #498882 - Flags: approval2.0?
Attachment #498882 - Flags: review?(roc)
Attachment #498882 - Flags: review+
Attachment #498882 - Flags: approval2.0?
Attachment #498882 - Flags: approval2.0+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b9
Crash Signature: [@ PresShell::GoToAnchor]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: