Changeset 160664 in webkit
- Timestamp:
- Dec 16, 2013 2:51:00 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r160662 r160664 1 2013-12-16 Anders Carlsson <andersca@apple.com> 2 3 Fix crash when trying to load a null HTML string 4 https://bugs.webkit.org/show_bug.cgi?id=125801 5 6 Reviewed by Dan Bernstein. 7 8 * WebProcess/WebPage/WebPage.cpp: 9 (WebKit::WebPage::loadString): 10 Check that the string is not null before calling is8Bit(). Also, Use the latin1 encoding for 11 8-bit strings, since Latin 1 strings are not necessarily valid UTF-8 strings. 12 1 13 2013-12-16 Dan Bernstein <mitz@apple.com> 2 14 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r160653 r160664 920 920 void WebPage::loadString(const String& htmlString, const String& MIMEType, const URL& baseURL, const URL& unreachableURL, CoreIPC::MessageDecoder& decoder) 921 921 { 922 if ( htmlString.is8Bit()) {922 if (!htmlString.isNull() && htmlString.is8Bit()) { 923 923 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(htmlString.characters8()), htmlString.length() * sizeof(LChar)); 924 loadDataImpl(sharedBuffer, MIMEType, ASCIILiteral(" utf-8"), baseURL, unreachableURL, decoder);924 loadDataImpl(sharedBuffer, MIMEType, ASCIILiteral("latin1"), baseURL, unreachableURL, decoder); 925 925 } else { 926 926 RefPtr<SharedBuffer> sharedBuffer = SharedBuffer::create(reinterpret_cast<const char*>(htmlString.characters16()), htmlString.length() * sizeof(UChar)); -
trunk/Tools/ChangeLog
r160655 r160664 1 2013-12-16 Anders Carlsson <andersca@apple.com> 2 3 Fix crash when trying to load a null HTML string 4 https://bugs.webkit.org/show_bug.cgi?id=125801 5 6 Reviewed by Dan Bernstein. 7 8 * TestWebKitAPI/Tests/WebKit2/WillLoad.cpp: 9 (TestWebKitAPI::TEST_F): 10 Update test results. 11 1 12 2013-12-16 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2/WillLoad.cpp
r160582 r160664 180 180 WKPageLoadHTMLStringWithUserData(webView->page(), htmlString.get(), baseURL.get(), userData.get()); 181 181 182 testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK(" utf-8").get(), 0, userData.get());182 testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("latin1").get(), 0, userData.get()); 183 183 } 184 184 … … 190 190 WKPageLoadHTMLString(webView->page(), htmlString.get(), baseURL.get()); 191 191 192 testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK(" utf-8").get(), 0, 0);192 testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("latin1").get(), 0, 0); 193 193 } 194 194 … … 203 203 WKPageLoadAlternateHTMLStringWithUserData(webView->page(), htmlString.get(), baseURL.get(), unreachableURL.get(), userData.get()); 204 204 205 testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK(" utf-8").get(), unreachableURL.get(), userData.get());205 testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("latin1").get(), unreachableURL.get(), userData.get()); 206 206 } 207 207 … … 215 215 WKPageLoadAlternateHTMLString(webView->page(), htmlString.get(), baseURL.get(), unreachableURL.get()); 216 216 217 testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK(" utf-8").get(), unreachableURL.get(), 0);217 testWillLoadDataRequestReturnValues(baseURL.get(), Util::toWK("text/html").get(), Util::toWK("latin1").get(), unreachableURL.get(), 0); 218 218 } 219 219 … … 226 226 227 227 WKRetainPtr<WKURLRef> blankURL = adoptWK(WKURLCreateWithUTF8CString("about:blank")); 228 testWillLoadDataRequestReturnValues(blankURL.get(), Util::toWK("text/plain").get(), Util::toWK(" utf-8").get(), 0, userData.get());228 testWillLoadDataRequestReturnValues(blankURL.get(), Util::toWK("text/plain").get(), Util::toWK("latin1").get(), 0, userData.get()); 229 229 } 230 230 … … 236 236 237 237 WKRetainPtr<WKURLRef> blankURL = adoptWK(WKURLCreateWithUTF8CString("about:blank")); 238 testWillLoadDataRequestReturnValues(blankURL.get(), Util::toWK("text/plain").get(), Util::toWK(" utf-8").get(), 0, 0);238 testWillLoadDataRequestReturnValues(blankURL.get(), Util::toWK("text/plain").get(), Util::toWK("latin1").get(), 0, 0); 239 239 } 240 240
Note: See TracChangeset
for help on using the changeset viewer.