Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: da6b7f167d01519d19d17ef6bcbfadbf5ac2a70b
      
https://github.com/WebKit/WebKit/commit/da6b7f167d01519d19d17ef6bcbfadbf5ac2a70b
  Author: Ahmad Saleem <[email protected]>
  Date:   2026-07-26 (Sun, 26 Jul 2026)

  Changed paths:
    M Source/WebCore/editing/ios/EditorIOS.mm
    M Source/WebCore/editing/mac/EditorMac.mm

  Log Message:
  -----------
  Potential crash pasting with no selection due to missing null-check on 
selectedRange()
https://bugs.webkit.org/show_bug.cgi?id=320195
rdar://183143887

Reviewed by Chris Dumez.

Editor::pasteWithPasteboard() dereferences the std::optional<SimpleRange>
returned by selectedRange() without checking it first. If there is no
selection, this could crash. The Windows, GLib, and libwpe backends
already guard against this case; add the same early-return guard to
the iOS and Mac backends for consistency and safety.

* Source/WebCore/editing/ios/EditorIOS.mm:
(WebCore::Editor::pasteWithPasteboard):
* Source/WebCore/editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):

Canonical link: https://commits.webkit.org/317946@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to