Source/WebCore/editing/cocoa/HTMLConverter.mm:1278:44: runtime error: member call...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Mar 2021 22:41:39 +0000 (22:41 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 26 Mar 2021 22:41:39 +0000 (22:41 +0000)
commita339c860096ac18311d75ad3d40caa52080da34c
tree2e5843b15b299f3616f6e21315d6e9abc607eee8
parentd5c1df893530f7ddde6f0659b55f00cd069e953d
Source/WebCore/editing/cocoa/HTMLConverter.mm:1278:44: runtime error: member call on null pointer of type 'WebCore::ArchiveResource'
https://bugs.webkit.org/show_bug.cgi?id=223696

Reviewed by Alex Christensen.

Fix bug found by UBSan.

* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_addAttachmentForElement):
- Drop duplicate call to dataSource->subresource(url) as it doesn't seem it can return something else
  than null if it returned null the first time around.
- Make sure resource is null-checked before we dereference it to get the MIME type.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/editing/cocoa/HTMLConverter.mm