Bug 114650 - WebKit should not decode or support PDF favicons
Summary: WebKit should not decode or support PDF favicons
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-04-15 17:25 PDT by Tim Horton
Modified: 2013-04-19 12:44 PDT (History)
5 users (show)

See Also:


Attachments
patch (1.96 KB, patch)
2013-04-15 17:38 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
patch (1.95 KB, patch)
2013-04-15 17:42 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
patch (1.95 KB, patch)
2013-04-15 17:42 PDT, Tim Horton
no flags Details | Formatted Diff | Diff
patch (1.88 KB, patch)
2013-04-15 17:45 PDT, Tim Horton
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-04-15 17:25:16 PDT
No other browser I can find supports this anyway. *We* don't even successfully display the image, but we try to.

<rdar://problem/10133914>
Comment 1 Tim Horton 2013-04-15 17:38:40 PDT
Created attachment 198207 [details]
patch

Not sure if this is a reasonable place to bail if we find PDF data, but... maybe?
Comment 2 WebKit Commit Bot 2013-04-15 17:39:54 PDT
Attachment 198207 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCore/loader/icon/IconLoader.cpp']" exit_code: 1
Source/WebCore/loader/icon/IconLoader.cpp:100:  Omit int when using unsigned  [runtime/unsigned] [1]
Source/WebCore/loader/icon/IconLoader.cpp:104:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Tim Horton 2013-04-15 17:42:14 PDT
Created attachment 198208 [details]
patch
Comment 4 Tim Horton 2013-04-15 17:42:50 PDT
Created attachment 198209 [details]
patch
Comment 5 Tim Horton 2013-04-15 17:45:26 PDT
Created attachment 198210 [details]
patch

oh boy
Comment 6 mitz 2013-04-18 20:40:28 PDT
Comment on attachment 198210 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=198210&action=review

> Source/WebCore/loader/icon/IconLoader.cpp:100
> +    static const char* pdfMagicNumber = "%PDF";
> +    static unsigned pdfMagicNumberLength = strlen(pdfMagicNumber);

I would have done this with a uint32_t constant (and gotten it wrong on big endian) or a char array that I could sizeof() instead of using strlen().
Comment 7 Tim Horton 2013-04-19 12:44:59 PDT
http://trac.webkit.org/changeset/148758