Bug 44564 - Null dereference possible in WebView::canShowMIMEType
Summary: Null dereference possible in WebView::canShowMIMEType
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Ada Chan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-24 16:46 PDT by Ada Chan
Modified: 2010-08-24 17:10 PDT (History)
0 users

See Also:


Attachments
Patch (1.27 KB, patch)
2010-08-24 17:05 PDT, Ada Chan
sfalken: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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