RESOLVED FIXED 55501
[Qt][WK2] Loading an empty URL crashes
https://bugs.webkit.org/show_bug.cgi?id=55501
Summary [Qt][WK2] Loading an empty URL crashes
Benjamin Poulain
Reported 2011-03-01 13:29:36 PST
WKPageLoadURL is not supposed to get null WKURLRef. This dereferences a null pointer: void WKPageLoadURL(WKPageRef pageRef, WKURLRef URLRef) { toImpl(pageRef)->loadURL(toImpl(URLRef)->string()); }
Attachments
Patch (4.93 KB, patch)
2011-03-01 14:02 PST, Benjamin Poulain
no flags
Patch (5.17 KB, patch)
2011-03-15 09:38 PDT, Benjamin Poulain
kling: review-
Patch (5.34 KB, patch)
2011-03-16 03:52 PDT, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2011-03-01 14:02:40 PST
WebKit Review Bot
Comment 2 2011-03-01 14:06:55 PST
Attachment 84290 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp:20: Found other header before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Benjamin Poulain
Comment 3 2011-03-15 09:38:16 PDT
Created attachment 85817 [details] Patch As Andreas pointed out on IRC, null WKURLRef are actually a valid value in the WebKit 2 C APIs. I changed the patch to take that into account. It happens that there is a method toWTFString() to do all the work for me :)
WebKit Review Bot
Comment 4 2011-03-15 09:39:52 PDT
Attachment 85817 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp:20: Found other header before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Andreas Kling
Comment 5 2011-03-15 11:58:46 PDT
Comment on attachment 85817 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=85817&action=review > Source/WebKit2/UIProcess/API/qt/tests/qgraphicswkview/tst_qgraphicswkview.cpp:99 > + // That should not crash. > + m_view->show(); > + m_view->m_webView->load(QUrl()); > + QTest::qWait(50); > + > + m_view->m_webView->load(QUrl("")); > + QTest::qWait(50); Let's use the QWKPage::engineConnectionChanged() signal to find out if the web process crashed. This test would never fail, since the autotest process cruises along happily.
Benjamin Poulain
Comment 6 2011-03-16 03:52:54 PDT
Created attachment 85921 [details] Patch > Let's use the QWKPage::engineConnectionChanged() signal to find out if the web process crashed. > This test would never fail, since the autotest process cruises along happily. Good point, I did not realize crashing the WebProcess would not have side effects on the test. Patch updated.
WebKit Review Bot
Comment 7 2011-03-16 03:57:24 PDT
Attachment 85921 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/tests/qwkpage/tst_qwkpage.cpp:20: Found other header before WebCore config.h. Should be: config.h, primary header, blank line, and then alphabetically sorted. [build/include_order] [4] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 8 2011-03-16 04:21:54 PDT
Comment on attachment 85921 [details] Patch Clearing flags on attachment: 85921 Committed r81237: <http://trac.webkit.org/changeset/81237>
WebKit Commit Bot
Comment 9 2011-03-16 04:21:59 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.