qt5base-lts/tests/auto/widgets/dialogs/qdialog
Marc Mutz 9c7be0a7ec Fix UB in tst_QDialog::showExtension()
Don't cast a QDialog to a subclass it is not.

Fix by creating it as the required subclass in the
first place.

Found by UBSan:
  tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp:203:20: runtime error: downcast of address 0x2b5f5000ad40 which does not point to an object of type 'DummyDialog'
  tests/auto/widgets/dialogs/qdialog/tst_qdialog.cpp:203:46: runtime error: member call on address 0x2b5f5000ad40 which does not point to an object of type 'DummyDialog'

Change-Id: I63ae7e782bda6a78d11af5c2bc2f7d88aacd0ac0
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-07 13:00:32 +00:00
..
.gitignore Moved tests into integrationtests/ and widgets/ 2011-10-20 19:45:41 +02:00
qdialog.pro Move SnapToDefaultButton from QPlatformDialogHelper to QPlatformTheme 2013-08-23 08:42:35 +02:00
tst_qdialog.cpp Fix UB in tst_QDialog::showExtension() 2016-01-07 13:00:32 +00:00