Changeset 128195 in webkit


Ignore:
Timestamp:
Sep 11, 2012 9:42:11 AM (12 years ago)
Author:
sergio@webkit.org
Message:

[GTK] WebKitGtk+ crashes with non-UTF8 HTTP header names
https://bugs.webkit.org/show_bug.cgi?id=96284

Reviewed by Gustavo Noronha Silva.

Source/WebCore:

Non UTF-8 characters sent as part of a HTTP header name were
causing crashes as String::fromUTF8() was returning NULL for
them. Use String::fromUTF8WithLatin1Fallback() instead.

Test: http/tests/misc/non-utf8-header-name.php

  • platform/network/soup/ResourceResponseSoup.cpp:

(WebCore::ResourceResponse::updateFromSoupMessage):

LayoutTests:

Added a new test to make sure that WebKitGtk+ does not crash when
a non-UTF8 character is sent as part of a HTTP header name.

  • http/tests/misc/non-utf8-header-name-expected.txt: Added.
  • http/tests/misc/non-utf8-header-name.php: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128193 r128195  
     12012-09-11  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [GTK] WebKitGtk+ crashes with non-UTF8 HTTP header names
     4        https://bugs.webkit.org/show_bug.cgi?id=96284
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Added a new test to make sure that WebKitGtk+ does not crash when
     9        a non-UTF8 character is sent as part of a HTTP header name.
     10
     11        * http/tests/misc/non-utf8-header-name-expected.txt: Added.
     12        * http/tests/misc/non-utf8-header-name.php: Added.
     13
    1142012-09-11  Csaba Osztrogonác  <ossy@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r128192 r128195  
     12012-09-11  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        [GTK] WebKitGtk+ crashes with non-UTF8 HTTP header names
     4        https://bugs.webkit.org/show_bug.cgi?id=96284
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Non UTF-8 characters sent as part of a HTTP header name were
     9        causing crashes as String::fromUTF8() was returning NULL for
     10        them. Use String::fromUTF8WithLatin1Fallback() instead.
     11
     12        Test: http/tests/misc/non-utf8-header-name.php
     13
     14        * platform/network/soup/ResourceResponseSoup.cpp:
     15        (WebCore::ResourceResponse::updateFromSoupMessage):
     16
    1172012-09-11  Sheriff Bot  <webkit.review.bot@gmail.com>
    218
  • trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp

    r128192 r128195  
    7070    soup_message_headers_iter_init(&headersIter, soupMessage->response_headers);
    7171    while (soup_message_headers_iter_next(&headersIter, &headerName, &headerValue))
    72         m_httpHeaderFields.set(String::fromUTF8(headerName),
     72        m_httpHeaderFields.set(String::fromUTF8WithLatin1Fallback(headerName, strlen(headerName)),
    7373                               String::fromUTF8WithLatin1Fallback(headerValue, strlen(headerValue)));
    7474
Note: See TracChangeset for help on using the changeset viewer.