Skip to content
Snippets Groups Projects
Commit d1d0a507 authored by Fatih Uzunoğlu's avatar Fatih Uzunoğlu Committed by Felix Paul Kühne
Browse files

contrib: qtdeclarative: add patch to prevent null pointer dereference in QQuickPopup

parent 49874dfa
No related branches found
No related tags found
1 merge request!6597contrib: qtdeclarative: prevent null pointer dereference in QQuickPopup
Pipeline #551957 passed with stage
in 48 minutes and 49 seconds
From 4c1fb51e53f0df69684ea811080d7b9ab222cff1 Mon Sep 17 00:00:00 2001
From: Fatih Uzunoglu <fuzun54@outlook.com>
Date: Wed, 1 Jan 2025 17:16:13 +0200
Subject: [PATCH] Add missing null pointer check in QQuickPopup
Otherwise in certain circumstances this causes
null pointer dereference induced crash.
This is only relevant when the new Qt 6.8 feature
`popupType: Popup.Window` is used where it makes
it possible for Quick Popups to have their own
independent windows.
---
src/quicktemplates/qquickpopup.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/quicktemplates/qquickpopup.cpp b/src/quicktemplates/qquickpopup.cpp
index 85062f44fd..f85bcdd296 100644
--- a/src/quicktemplates/qquickpopup.cpp
+++ b/src/quicktemplates/qquickpopup.cpp
@@ -1104,7 +1104,8 @@ void QQuickPopupPrivate::adjustPopupItemParentAndWindow()
popupItem->setParentItem(popupWindow->contentItem());
popupItem->forceActiveFocus(Qt::PopupFocusReason);
}
- popupWindow->setVisible(visible);
+ if (popupWindow)
+ popupWindow->setVisible(visible);
} else {
if (visible) {
popupItem->setParentItem(overlay);
--
2.47.1
......@@ -35,6 +35,7 @@ $(TARBALLS)/qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz:
qtdeclarative: qtdeclarative-everywhere-src-$(QTDECLARATIVE_VERSION).tar.xz .sum-qtdeclarative
$(UNPACK)
$(APPLY) $(SRC)/qtdeclarative/0001-Add-missing-disconnect-and-null-check-in-QQuickPopup.patch
$(APPLY) $(SRC)/qtdeclarative/0001-Add-missing-null-pointer-check-in-QQuickPopup.patch
# disable unused CLI tools: qml, qmleasing, qmldom, qmlformat, qmltc
sed -i.orig -e 's,add_subdirectory(qml),#add_subdirectory(qml),' $(UNPACK_DIR)/tools/CMakeLists.txt
sed -i.orig -e 's,add_subdirectory(qmleasing),#add_subdirectory(qmleasing),' $(UNPACK_DIR)/tools/CMakeLists.txt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment