Title: [128175] trunk
- Revision
- 128175
- Author
- [email protected]
- Date
- 2012-09-11 06:11:22 -0700 (Tue, 11 Sep 2012)
Log 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.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (128174 => 128175)
--- trunk/LayoutTests/ChangeLog 2012-09-11 13:06:39 UTC (rev 128174)
+++ trunk/LayoutTests/ChangeLog 2012-09-11 13:11:22 UTC (rev 128175)
@@ -1,3 +1,16 @@
+2012-09-11 Sergio Villar Senin <[email protected]>
+
+ [GTK] WebKitGtk+ crashes with non-UTF8 HTTP header names
+ https://bugs.webkit.org/show_bug.cgi?id=96284
+
+ Reviewed by Gustavo Noronha Silva.
+
+ 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.
+
2012-09-11 Christophe Dumez <[email protected]>
[WK2][WKTR] TestRunner needs to implement clearApplicationCacheForOrigin
Added: trunk/LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt (0 => 128175)
--- trunk/LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt (rev 0)
+++ trunk/LayoutTests/http/tests/misc/non-utf8-header-name-expected.txt 2012-09-11 13:11:22 UTC (rev 128175)
@@ -0,0 +1 @@
+Test for bug 96284: Non UTF-8 HTTP headers do not cause a crash.
Added: trunk/LayoutTests/http/tests/misc/non-utf8-header-name.php (0 => 128175)
--- trunk/LayoutTests/http/tests/misc/non-utf8-header-name.php (rev 0)
+++ trunk/LayoutTests/http/tests/misc/non-utf8-header-name.php 2012-09-11 13:11:22 UTC (rev 128175)
@@ -0,0 +1,9 @@
+<?php
+header('HTTP/1.1 200 OK');
+header('\xC3: text/html');
+echo '<script>';
+echo ' if (window.testRunner)';
+echo ' testRunner.dumpAsText();';
+echo '</script>';
+echo '<p>Test for <a href="" 96284</a>: Non UTF-8 HTTP headers do not cause a crash.</p>';
+?>
Modified: trunk/Source/WebCore/ChangeLog (128174 => 128175)
--- trunk/Source/WebCore/ChangeLog 2012-09-11 13:06:39 UTC (rev 128174)
+++ trunk/Source/WebCore/ChangeLog 2012-09-11 13:11:22 UTC (rev 128175)
@@ -1,3 +1,19 @@
+2012-09-11 Sergio Villar Senin <[email protected]>
+
+ [GTK] WebKitGtk+ crashes with non-UTF8 HTTP header names
+ https://bugs.webkit.org/show_bug.cgi?id=96284
+
+ Reviewed by Gustavo Noronha Silva.
+
+ 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):
+
2012-09-11 Tor Arne Vestbø <[email protected]>
[Qt] Add a configure step to the Qt build system
Modified: trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp (128174 => 128175)
--- trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp 2012-09-11 13:06:39 UTC (rev 128174)
+++ trunk/Source/WebCore/platform/network/soup/ResourceResponseSoup.cpp 2012-09-11 13:11:22 UTC (rev 128175)
@@ -69,7 +69,7 @@
soup_message_headers_iter_init(&headersIter, soupMessage->response_headers);
while (soup_message_headers_iter_next(&headersIter, &headerName, &headerValue))
- m_httpHeaderFields.set(String::fromUTF8(headerName),
+ m_httpHeaderFields.set(String::fromUTF8WithLatin1Fallback(headerName, strlen(headerValue)),
String::fromUTF8WithLatin1Fallback(headerValue, strlen(headerValue)));
m_soupFlags = soup_message_get_flags(soupMessage);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes