Bug 251353

Summary: UIProcess API WKPageGetContentsAsMHTMLData does not complete callback if MHTML flag is OFF
Product: WebKit Reporter: kiran <kiran.happy>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Trivial CC: achristensen, mcatanzaro, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   

Description kiran 2023-01-30 05:06:53 PST
In file API/C/WKPage.cpp method [WKPageGetContentsAsMHTMLData](https://github.com/WebKit/WebKit/blob/0c8fb49c7a40115abe543963829eb8268b96d048/Source/WebKit/UIProcess/API/C/WKPage.cpp#L2673)  does not complete callback if MHTML build (private) flag is OFF.

To add, it appears like [consumers](https://github.com/search?l=C%2B%2B&q=WKPageGetContentsAsMHTMLData&type=Code) of WKPageGetContentsAsMHTMLData, might crash if this callback gets invoked with null values. Most of them are not checking WKErrorRef and doing a reinterpret_cast of WKDataRef.
Comment 1 Radar WebKit Bug Importer 2023-02-06 05:07:20 PST
<rdar://problem/105078481>