Firefox · Layout
CVE-2026-117867
Logic Error in Layout
Overview
High
Severity
—
CVSS
No
Exploited ITW
Fixed
Fix Status
Files Changed
layout/generic/nsFrameSelection.cpp
Patch
diff --git a/layout/generic/nsFrameSelection.cpp b/layout/generic/nsFrameSelection.cpp
index 828c174039a..be22915490c 100644
--- a/layout/generic/nsFrameSelection.cpp
+++ b/layout/generic/nsFrameSelection.cpp
@@ -1225,8 +1225,10 @@ void nsFrameSelection::MaintainedRange::AdjustNormalSelection(
if ((*relToStart <= 0 && *relToEnd >= 0) ||
(*relToStart > 0 && aNormalSelection.GetDirection() == eDirNext) ||
(*relToEnd < 0 && aNormalSelection.GetDirection() == eDirPrevious)) {
+ // Ensure we hold a strong ref to the range across ReplaceAnchorFocusRange.
+ const RefPtr range = mRange;
// Set the current range to the maintained range.
- aNormalSelection.ReplaceAnchorFocusRange(mRange);
+ aNormalSelection.ReplaceAnchorFocusRange(range);
// Set the direction of the selection so that the anchor will be on the
// far side of the maintained selection, relative to aContent/aOffset.
aNormalSelection.SetDirection(*relToStart > 0 ? eDirPrevious : eDirNext);
Loading diff…
References
On This Page