summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwidget.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-08-01 10:05:28 +0300
committerMarc Mutz <marc.mutz@kdab.com>2016-08-01 16:07:24 +0000
commita81be85b63f8caf817bb7c4a840ff3a3aaf49a83 (patch)
tree7154369c0c08c0076d48ca45f4b97af222fda19b /src/widgets/kernel/qwidget.h
parentd38f86e50b01c6dd60f5a97355031e08d6a47d18 (diff)
QDataWidgetMapper: Fix UB (member call)
As found by UBSan: qdatawidgetmapper.cpp:212:59: runtime error: member call on address 0x2b6cc8095be0 which does not point to an object of type 'QFocusHelper' 0x2b6cc8095be0: note: object is of type 'QLineEdit' Just make QDataWidgetMapperPrivate a friend of QWidget. Change-Id: I33d8d430c3a03b7173358d0f96dc7f850d11697c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/kernel/qwidget.h')
-rw-r--r--src/widgets/kernel/qwidget.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h
index 2af1550ad1..c8e08a5bc4 100644
--- a/src/widgets/kernel/qwidget.h
+++ b/src/widgets/kernel/qwidget.h
@@ -668,6 +668,7 @@ protected:
void destroy(bool destroyWindow = true,
bool destroySubWindows = true);
+ friend class QDataWidgetMapperPrivate; // for access to focusNextPrevChild
virtual bool focusNextPrevChild(bool next);
inline bool focusNextChild() { return focusNextPrevChild(true); }
inline bool focusPreviousChild() { return focusNextPrevChild(false); }