Go to file
Marc Mutz b4995eb749 QStackedLayout: Fix UB (invalid cast) in qt_wasDeleted()
Found by UBSan:

  qstackedlayout.cpp:261:98: runtime error: downcast of address 0x60400003cd10 which does not point to an object of type 'QtFriendlyLayoutWidget'
  0x60400003cd10: note: object is of type 'QWidget'
   0e 00 80 76  70 0b 06 3f d6 2a 00 00  00 99 00 00 50 61 00 00  20 0d 06 3f d6 2a 00 00  00 00 be be
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QWidget'
    #0 0x2ad637b8f58f in qt_wasDeleted qstackedlayout.cpp:261
    #1 0x2ad637b8f58f in QStackedLayout::takeAt(int) qstackedlayout.cpp:285
    #2 0x2ad637b4afcb in QLayout::removeWidget(QWidget*) qlayout.cpp:1369
    #3 0x413534 in tst_QStackedLayout::testCase() tst_qstackedlayout.cpp:155

Caused by using a struct to get access to QWidgetPrivate::wasDeleted
using a cast.  That cast is invalid, of course, so simply use
QWidgetPrivate::get().

Caveat: we need a const version of that function, but that didn't
exist, yet, so added one.

Change-Id: I27d449b90be7e2072646d950c676b500ef698349
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-27 04:22:44 +00:00
bin Fix syncqt.pl not respecting #pragma qt_no_master_include in files with Windows line endings 2016-02-25 16:25:37 +00:00
config.tests libjpeg config test: init variable 2016-09-16 04:12:03 +00:00
dist add buildsystem changelog for 5.6.2 2016-09-25 06:42:29 +00:00
doc Doc: Change instances of '(Mac) OS X' to 'macOS' 2016-08-12 08:30:29 +00:00
examples Fix compilation of findfiles examples with QT_NO_CLIPBOARD 2016-09-05 04:55:02 +00:00
lib
mkspecs Pass -quiet to xcodebuild when invoking make with -s option 2016-09-21 21:42:22 +00:00
qmake Fix code signing for qmake-generated Xcode projects in Xcode 8 (again) 2016-09-22 06:04:57 +00:00
src QStackedLayout: Fix UB (invalid cast) in qt_wasDeleted() 2016-09-27 04:22:44 +00:00
tests QObject test: check that throwing from a child's constructor works 2016-09-26 04:47:06 +00:00
tools configure.exe: Write MSVC compiler version to qconfig.pri 2016-09-03 20:13:50 +00:00
util Don't use QStringLiteral in comparisons 2016-01-28 18:00:47 +00:00
.gitattributes
.gitignore Update gitignore 2016-08-19 10:43:26 +00:00
.qmake.conf Bump version 2016-05-23 18:28:33 +00:00
.tag
configure Pass no-pkg-config to qmake from config.test if appropriate 2016-08-25 12:09:13 +00:00
configure.bat Move the official Qt version from qglobal.h to .qmake.conf 2015-10-14 20:12:57 +00:00
header.BSD Updated BSD licensed file headers 2015-02-15 07:41:17 +00:00
header.COMM Add header template for commercial only modules 2015-10-19 10:37:18 +00:00
header.FDL Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL3 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL3-COMM Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL21 Update copyright headers 2015-02-11 06:49:51 +00:00
header.LGPL-ONLY Update copyright headers 2015-02-11 06:49:51 +00:00
INSTALL Doc: Update links in INSTALL file 2015-02-16 09:06:41 +00:00
LGPL_EXCEPTION.txt Update copyright headers 2015-02-11 06:49:51 +00:00
LICENSE.FDL
LICENSE.GPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPLv3 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.LGPLv21 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit" 2016-06-15 07:02:32 +00:00
LICENSE.PREVIEW.COMMERCIAL Update copyright headers 2015-02-11 06:49:51 +00:00
qtbase.pro Install fixqt4headers.pl script 2015-11-14 12:46:50 +00:00
sync.profile make a proper header-only module for QtZlib 2015-11-17 20:22:17 +00:00