<?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>25001</bug_id>
          
          <creation_ts>2009-04-02 07:48:55 -0700</creation_ts>
          <short_desc>Crash when content type parameters have no value</short_desc>
          <delta_ts>2009-04-02 10:12:10 -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>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.tvmunchies.com/2009/03/csi-miami-cartoon-nsfw.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk, Soup</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gustavo Noronha (kov)">gustavo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>plaes</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>116273</commentid>
    <comment_count>0</comment_count>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2009-04-02 07:48:55 -0700</bug_when>
    <thetext>When the Content-Type header has parameters with no = sign, soup_message_headers_get_content_type () will return a hash table which contains NULL as the value for the relevant name. The problem here is that soup_header_g_string_append_param () doesn&apos;t expect NULL values, as it should, leading to a crash.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116274</commentid>
    <comment_count>1</comment_count>
      <attachid>29189</attachid>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2009-04-02 07:53:20 -0700</bug_when>
    <thetext>Created attachment 29189
Handle the case where a Content-Type header parameter has no value

(i.e. no = character), to work-around a bug in libsoup.
---
 WebCore/ChangeLog                                  |   13 +++++++++++++
 .../platform/network/soup/ResourceHandleSoup.cpp   |    5 +++++
 2 files changed, 18 insertions(+), 0 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116275</commentid>
    <comment_count>2</comment_count>
      <attachid>29189</attachid>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2009-04-02 07:54:04 -0700</bug_when>
    <thetext>Comment on attachment 29189
Handle the case where a Content-Type header parameter has no value

As commented in the code, this has been reported to soup: http://bugzilla.gnome.org/show_bug.cgi?id=577728</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116278</commentid>
    <comment_count>3</comment_count>
      <attachid>29189</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-04-02 08:15:28 -0700</bug_when>
    <thetext>Comment on attachment 29189
Handle the case where a Content-Type header parameter has no value

r=me, because this just fixes a crash, but I really, really dislike removing const from &quot;const char*&quot; here. A quick web search suggests that soup_header_g_string_append_param takes const char* parameters, so there should be no reason to do make such unsafe conversions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116283</commentid>
    <comment_count>4</comment_count>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2009-04-02 08:43:01 -0700</bug_when>
    <thetext>Landed as r42168, after reworking the constness, and casting with ap on IRC.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116292</commentid>
    <comment_count>5</comment_count>
    <who name="Priit Laes (IRC: plaes)">plaes</who>
    <bug_when>2009-04-02 09:43:31 -0700</bug_when>
    <thetext>Please don&apos;t close this one yet, as this workaround can be removed later when new version of libsoup is out by just updating required libsoup version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>116298</commentid>
    <comment_count>6</comment_count>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2009-04-02 10:12:10 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; Please don&apos;t close this one yet, as this workaround can be removed later when
&gt; new version of libsoup is out by just updating required libsoup version.
&gt; 

I added a comment to the code to that effect, so I don&apos;t see a need to keep the bug open. The whole content type sniffing code is a work-around to be removed when soup (or webcore) provide that to us, actually.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>29189</attachid>
            <date>2009-04-02 07:53:20 -0700</date>
            <delta_ts>2009-04-02 08:15:28 -0700</delta_ts>
            <desc>Handle the case where a Content-Type header parameter has no value</desc>
            <filename>Handle-the-case-where-a-Content-Type-header-parameter-has-no-value.patch</filename>
            <type>text/plain</type>
            <size>1679</size>
            <attacher name="Gustavo Noronha (kov)">gustavo</attacher>
            
              <data encoding="base64">YTBhNGQ3YjY0Mzg0MzI0NmZhNzlkZjMyMjE4MjJmZTEwZGJiZDJhYgpkaWZmIC0tZ2l0IGEvV2Vi
Q29yZS9DaGFuZ2VMb2cgYi9XZWJDb3JlL0NoYW5nZUxvZwppbmRleCA0ZjYwM2FjLi45ODQ5MmEw
IDEwMDY0NAotLS0gYS9XZWJDb3JlL0NoYW5nZUxvZworKysgYi9XZWJDb3JlL0NoYW5nZUxvZwpA
QCAtMSwzICsxLDE2IEBACisyMDA5LTA0LTAyICBHdXN0YXZvIE5vcm9uaGEgU2lsdmEgIDxndXN0
YXZvLm5vcm9uaGFAY29sbGFib3JhLmNvLnVrPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9E
WSAoT09QUyEpLgorCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNn
aT9pZD0yNTAwMQorICAgICAgICBDcmFzaCB3aGVuIGNvbnRlbnQgdHlwZSBwYXJhbWV0ZXJzIGhh
dmUgbm8gdmFsdWUKKworICAgICAgICBIYW5kbGUgdGhlIGNhc2Ugd2hlcmUgYSBDb250ZW50LVR5
cGUgaGV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
S2V5LCAmaGFzaFZhbHVlKSkgeworICAgICAgICAgICAgLy8gV29yay1hcm91bmQgYnVnIGluIHNv
dXAgd2hpY2ggY2F1c2VzIGEgY3Jhc2g7CisgICAgICAgICAgICAvLyBTZWUgaHR0cDovL2J1Z3pp
bGxhLmdub21lLm9yZy9zaG93X2J1Zy5jZ2k/aWQ9NTc3NzI4CisgICAgICAgICAgICBpZiAoIWhh
c2hWYWx1ZSkKKyAgICAgICAgICAgICAgICBoYXNoVmFsdWUgPSBjb25zdF9jYXN0PGNoYXIqPigi
Iik7CisKICAgICAgICAgICAgIGdfc3RyaW5nX2FwcGVuZChwYXJhbWV0ZXJzU3RyaW5nLCAiOyAi
KTsKICAgICAgICAgICAgIHNvdXBfaGVhZGVyX2dfc3RyaW5nX2FwcGVuZF9wYXJhbShwYXJhbWV0
ZXJzU3RyaW5nLCBzdGF0aWNfY2FzdDxjaGFyKj4oaGFzaEtleSksIHN0YXRpY19jYXN0PGNoYXIq
PihoYXNoVmFsdWUpKTsKICAgICAgICAgfQo=
</data>
<flag name="review"
          id="14473"
          type_id="1"
          status="+"
          setter="ap"
    />
          </attachment>
      

    </bug>

</bugzilla>