Bug 44564

Summary: Null dereference possible in WebView::canShowMIMEType
Product: WebKit Reporter: Ada Chan <adachan>
Component: WebKit Misc.Assignee: Ada Chan <adachan>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch sfalken: review+

Description Ada Chan 2010-08-24 16:46:15 PDT
This is a snippet from WebView::canShowMIMEType():

    *canShow = MIMETypeRegistry::isSupportedImageMIMEType(mimeTypeStr) ||
        MIMETypeRegistry::isSupportedNonImageMIMEType(mimeTypeStr) ||
        (m_page && m_page->pluginData()->supportsMimeType(mimeTypeStr)) ||
        shouldUseEmbeddedView(mimeTypeStr);

m_page->pluginData() can return null if plugins are disabled on the user's system and we'd crash in that case.  We should null check m_page->pluginData().
Comment 1 Ada Chan 2010-08-24 16:47:24 PDT
<rdar://problem/8185379>
Comment 2 Ada Chan 2010-08-24 17:05:22 PDT
Created attachment 65346 [details]
Patch

Null check return value of m_page->pluginData() before accessing it.
Comment 3 Ada Chan 2010-08-24 17:10:23 PDT
Committed fix: r65952