QAbstractButton: don't access nullptr in queryButtonList()
When a button has no parent, QAbstractButtonPrivate::queryButtonList() unconditionally accessed parent which results in a nullptr access. Did not crash because qt_qFindChildren_helper checks for nullptr and therefore could only be found with a sanitizer. Fixes: QTBUG-83865 Change-Id: I591e546e96acba50770935b9c3baaf08b09b833d Pick-to: 6.0 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>bb10
parent
e334d6f9a7
commit
f0818f6ed8
|
|
@ -190,7 +190,9 @@ QList<QAbstractButton *>QAbstractButtonPrivate::queryButtonList() const
|
|||
return group->d_func()->buttonList;
|
||||
#endif
|
||||
|
||||
QList<QAbstractButton*>candidates = parent->findChildren<QAbstractButton *>();
|
||||
if (!parent)
|
||||
return {};
|
||||
QList<QAbstractButton *> candidates = parent->findChildren<QAbstractButton *>();
|
||||
if (autoExclusive) {
|
||||
auto isNoMemberOfMyAutoExclusiveGroup = [](QAbstractButton *candidate) {
|
||||
return !candidate->autoExclusive()
|
||||
|
|
|
|||
Loading…
Reference in New Issue