<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>47661</bug_id>
          
          <creation_ts>2010-10-14 04:11:43 -0700</creation_ts>
          <short_desc>Invalid base64 data in orphaned-selection-crash-bug32823-2.html</short_desc>
          <delta_ts>2022-07-31 12:15:52 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Sergio Villar Senin">svillar</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>darin</cc>
    
    <cc>mrobinson</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>294041</commentid>
    <comment_count>0</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2010-10-14 04:11:43 -0700</bug_when>
    <thetext>That test includes this base64 encoded data

iVBORw0KGrkJggg==

which has 1 extra padding &apos;=&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294043</commentid>
    <comment_count>1</comment_count>
      <attachid>70724</attachid>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2010-10-14 04:18:32 -0700</bug_when>
    <thetext>Created attachment 70724
Fix for the bug

Removes an invalid extra &quot;=&quot; padding character in the data URL</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294067</commentid>
    <comment_count>2</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2010-10-14 05:35:26 -0700</bug_when>
    <thetext>Adding Ryosuke</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294124</commentid>
    <comment_count>3</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2010-10-14 08:37:49 -0700</bug_when>
    <thetext>Adding Darin also as he reviewed the patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294134</commentid>
    <comment_count>4</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2010-10-14 08:43:29 -0700</bug_when>
    <thetext>Is it possible to instead make the libsoup Data URI implementation resilient against extra data in the URL?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294141</commentid>
    <comment_count>5</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2010-10-14 08:55:03 -0700</bug_when>
    <thetext>Looks like you&apos;ve done that here: https://bugs.webkit.org/show_bug.cgi?id=47666 I suppose we should wait to see if that change fixes this failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294145</commentid>
    <comment_count>6</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2010-10-14 09:00:27 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Is it possible to instead make the libsoup Data URI implementation resilient against extra data in the URL?

Indeed it&apos;s possible, but if the test is wrong I guess we should fix that IMHO</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294152</commentid>
    <comment_count>7</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-10-14 09:37:21 -0700</bug_when>
    <thetext>Are you sure the original crash reproduces with the extra =?  It&apos;s quite possible that missing = was intentional because it&apos;s a crash test.  The test just needs to produce a crash, it doesn&apos;t need to be &apos;correct&apos;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294175</commentid>
    <comment_count>8</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2010-10-14 10:20:48 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Are you sure the original crash reproduces with the extra =?  It&apos;s quite possible that missing = was intentional because it&apos;s a crash test.  The test just needs to produce a crash, it doesn&apos;t need to be &apos;correct&apos;.

Thx for the answer Ryosuke. I don&apos;t know the code that was causing the crash in detail but it seems that the extra &quot;=&quot; does not have to do with the original problem. Just pinging you to know if that was intentional or not, but I guess I can double-check that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294179</commentid>
    <comment_count>9</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-10-14 10:25:41 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; Thx for the answer Ryosuke. I don&apos;t know the code that was causing the crash in detail but it seems that the extra &quot;=&quot; does not have to do with the original problem. Just pinging you to know if that was intentional or not, but I guess I can double-check that.

Could you download the code BEFORE r66032 (http://trac.webkit.org/changeset/66032) and make sure WebKit crashes with your fix?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294289</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-10-14 12:38:59 -0700</bug_when>
    <thetext>Note that Safari (or more precisely, CFNetwork) is strict in this respect - &quot;data:image/png;base64,iVBORw0KGrkJggg==&quot; fails to load, while &quot;data:image/png;base64,iVBORw0KGrkJggg=&quot; loads fine (but then fails to render, since the data itself is of course broken). This matches Firefox.

So, I suspect that both this change and the change in bug 47666 are wrong. There is probably some difference in how failed data: load is reported by libsoup, which was making the layout test fail.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294299</commentid>
    <comment_count>11</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2010-10-14 12:54:08 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; Note that Safari (or more precisely, CFNetwork) is strict in this respect - &quot;data:image/png;base64,iVBORw0KGrkJggg==&quot; fails to load, while &quot;data:image/png;base64,iVBORw0KGrkJggg=&quot; loads fine (but then fails to render, since the data itself is of course broken). This matches Firefox.
&gt; 
&gt; So, I suspect that both this change and the change in bug 47666 are wrong. There is probably some difference in how failed data: load is reported by libsoup, which was making the layout test fail.

Yeah, only if they cc-ed me in the bug 47666, I could have stopped them from making that change :( Or that I should have been more careful after I checked in the test.  Nonetheless, we should verify that this change won&apos;t &quot;fix&quot; the crash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>294619</commentid>
    <comment_count>12</comment_count>
    <who name="Sergio Villar Senin">svillar</who>
    <bug_when>2010-10-15 00:50:52 -0700</bug_when>
    <thetext>(In reply to comment #11)
&gt; (In reply to comment #10)
&gt; &gt; Note that Safari (or more precisely, CFNetwork) is strict in this respect - &quot;data:image/png;base64,iVBORw0KGrkJggg==&quot; fails to load, while &quot;data:image/png;base64,iVBORw0KGrkJggg=&quot; loads fine (but then fails to render, since the data itself is of course broken). This matches Firefox.
&gt; &gt; 
&gt; &gt; So, I suspect that both this change and the change in bug 47666 are wrong. There is probably some difference in how failed data: load is reported by libsoup, which was making the layout test fail.
&gt; 
&gt; Yeah, only if they cc-ed me in the bug 47666, I could have stopped them from making that change :( Or that I should have been more careful after I checked in the test.  Nonetheless, we should verify that this change won&apos;t &quot;fix&quot; the crash.

Thx Ryosuke and Alexey for your comments. I&apos;d most likely reopen 47666 in order to fix it properly. I just would like to know if there is any spec that mentions how to deal with invalid base64 data. I guess that the right behaviour is to fail the load as Safari does.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887711</commentid>
    <comment_count>13</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-29 11:20:41 -0700</bug_when>
    <thetext>I think this was workaround by following commit - https://github.com/WebKit/WebKit/commit/6a237ea157f017c19e1e12273af6bb4c1823050a

Do we need this fix now? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1887968</commentid>
    <comment_count>14</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-31 12:15:52 -0700</bug_when>
    <thetext>Looks like this issue sorted itself out.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>70724</attachid>
            <date>2010-10-14 04:18:32 -0700</date>
            <delta_ts>2010-10-14 12:39:16 -0700</delta_ts>
            <desc>Fix for the bug</desc>
            <filename>0001-Fix-for-the-bug.patch</filename>
            <type>text/plain</type>
            <size>1878</size>
            <attacher name="Sergio Villar Senin">svillar</attacher>
            
              <data encoding="base64">RnJvbSBhZDA3NGI2NzYxMjY3NzQ5NGFiMmY3ZTZlYmU0NDgxZjRmODNjZTgwIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBTZXJnaW8gVmlsbGFyIFNlbmluIDxzdmlsbGFyQGlnYWxpYS5j
b20+CkRhdGU6IFRodSwgMTQgT2N0IDIwMTAgMTM6MTY6NTUgKzAyMDAKU3ViamVjdDogW1BBVENI
XSBGaXggZm9yIHRoZSBidWcKCi0tLQogTGF5b3V0VGVzdHMvQ2hhbmdlTG9nICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgfCAgIDExICsrKysrKysrKysrCiAuLi4vdW5kby9vcnBoYW5lZC1z
ZWxlY3Rpb24tY3Jhc2gtYnVnMzI4MjMtMi5odG1sICB8ICAgIDIgKy0KIDIgZmlsZXMgY2hhbmdl
ZCwgMTIgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9MYXlvdXRU
ZXN0cy9DaGFuZ2VMb2cgYi9MYXlvdXRUZXN0cy9DaGFuZ2VMb2cKaW5kZXggMzI0NzY1OC4uMzYw
Mjc5MCAxMDA2NDQKLS0tIGEvTGF5b3V0VGVzdHMvQ2hhbmdlTG9nCisrKyBiL0xheW91dFRlc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MtMi5odG1sCkBA
IC01LDcgKzUsNyBAQCBpZiAod2luZG93LmxheW91dFRlc3RDb250cm9sbGVyKQogZG9jdW1lbnQu
ZXhlY0NvbW1hbmQoIk91dGRlbnQiLCBmYWxzZSwgMjYyMTQwKTsNCiBkb2N1bWVudC5kZXNpZ25N
b2RlID0gIm9uIjsNCiBkb2N1bWVudC5leGVjQ29tbWFuZCgiU2VsZWN0QWxsIiwgZmFsc2UsICJo
dHRwczovL3d3dy5leGFtcGxlLmNvbSIpOw0KLWRvY3VtZW50LmV4ZWNDb21tYW5kKCJpbnNlcnRp
bWFnZSIsIGZhbHNlLCAiZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR3JrSmdnZz09Iik7
DQorZG9jdW1lbnQuZXhlY0NvbW1hbmQoImluc2VydGltYWdlIiwgZmFsc2UsICJkYXRhOmltYWdl
L3BuZztiYXNlNjQsaVZCT1J3MEtHcmtKZ2dnPSIpOw0KIGRvY3VtZW50LmV4ZWNDb21tYW5kKCJz
ZWxlY3RhbGwiLCBmYWxzZSwgTmFOKTsNCiBkb2N1bWVudC5leGVjQ29tbWFuZCgic3RyaWtldGhy
b3VnaCIsIGZhbHNlLCAiZ29waGVyOi8vd3d3LmV4YW1wbGUuY29tIik7DQogZG9jdW1lbnQuZXhl
Y0NvbW1hbmQoIk1vdmVXb3JkRm9yd2FyZCIsIGZhbHNlLCA0MTAwKTsNCi0tIAoxLjcuMQoK
</data>
<flag name="review"
          id="60611"
          type_id="1"
          status="-"
          setter="ap"
    />
          </attachment>
      

    </bug>

</bugzilla>