qt5-qtwebkit/qtwebkit-5.212.0-alpha2-fix-null-pointer-dereference.patch
2017-10-24 23:49:48 +02:00

16 lines
842 B
Diff

diff -ur qtwebkit-5.212.0-alpha2/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp qtwebkit-5.212.0-alpha2-fix-null-pointer-dereference/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
--- qtwebkit-5.212.0-alpha2/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp 2017-06-09 16:11:36.000000000 +0200
+++ qtwebkit-5.212.0-alpha2-fix-null-pointer-dereference/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp 2017-10-24 21:44:40.504943501 +0200
@@ -390,7 +390,10 @@
QString QWebPageAdapter::selectedHtml() const
{
- return page->focusController().focusedOrMainFrame().editor().selectedRange()->toHTML();
+ RefPtr<Range> range = page->focusController().focusedOrMainFrame().editor().selectedRange();
+ if (!range)
+ return QString();
+ return range->toHTML();
}
bool QWebPageAdapter::isContentEditable() const