Skip to content

Commit de115e2

Browse files
authored
[ASTextNode2] Check that rangeOut is non-nil before dereferencing (#1980)
rangeOut is a nullable parameter, but we are treating it as though it is always not null. Make sure it is not null before dereferencing it.
1 parent 3776c89 commit de115e2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Source/ASTextNode2.mm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,9 @@ - (id)_linkAttributeValueAtPoint:(CGPoint)point
702702
continue;
703703
}
704704

705-
*rangeOut = NSIntersectionRange(visibleRange, effectiveRange);
705+
if (rangeOut != NULL) {
706+
*rangeOut = NSIntersectionRange(visibleRange, effectiveRange);
707+
}
706708

707709
if (attributeNameOut != NULL) {
708710
*attributeNameOut = attributeName;

0 commit comments

Comments
 (0)