MFH: r468386

Import upstream commit fixing a crash caused by a null pointer
dereference.

Approved by:		kde (tcberner)
Obtained from:		0e75f3272d
Differential Revision:	https://reviews.freebsd.org/D15210

Approved by:		ports-secteam (riggs)
This commit is contained in:
Guido Falsi 2018-04-29 12:14:03 +00:00
parent fcef5f0e19
commit e475c8dc24
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/branches/2018Q2/; revision=468623
2 changed files with 19 additions and 1 deletions

View File

@ -2,7 +2,7 @@
PORTNAME= webkit
DISTVERSION= 5.212.0-alpha2
PORTREVISION= 6
PORTREVISION= 7
CATEGORIES= www
MASTER_SITES= https://github.com/annulen/${PORTNAME}/releases/download/${DISTNAME}/
PKGNAMEPREFIX= qt5-

View File

@ -0,0 +1,18 @@
Fix crash in QWebPage::selectedHtml() when selectedRange is nullptr
obtained from: https://github.com/annulen/webkit/commit/0e75f3272d149bc64899c161f150eb341a2417af
--- Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp.orig 2017-06-09 14:11:36 UTC
+++ Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -390,7 +390,10 @@ QString QWebPageAdapter::selectedText() const
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