qt5base-lts/tests/auto
Marc Mutz e2e107556d tst_QGraphicsItem: Fix UB (invalid cast/member call) in prepareGeometryChange()
Found by UBSan:

  tst_qgraphicsitem.cpp:5066:29: runtime error: downcast of address 0x2afcb006c7f0 which does not point to an object of type 'GeometryChanger'
  0x2afcb006c7f0: note: object is of type 'QGraphicsRectItem'
   00 00 00 00  d8 64 ca 98 fc 2a 00 00  40 a9 0b b0 fc 2a 00 00  75 65 29 00 00 00 00 00  35 00 00 00
                ^~~~~~~~~~~~~~~~~~~~~~~
                vptr for 'QGraphicsRectItem'
      #0 0x4c5f1c in tst_QGraphicsItem::prepareGeometryChange() tst_qgraphicsitem.cpp:5066

Fix by actually instantiating a GeometryChanger, which incidentally is
the pattern used by paint() a few lines below, too.

While at it, allocate the item on the stack (as is done in paint())
and create a local QRectF variable to avoid repeating the same magic
numbers over and over again.

Change-Id: If5a3d56511000a17703d78d7dd1f0ea072b8bc11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-22 15:25:18 +00:00
..
android Fix typo in test results report for android 2015-07-28 21:16:19 +00:00
bic/data bic: Add 5.{1,2,3,4}.0 bic data for linux-gcc-amd64 2015-02-14 06:54:20 +00:00
cmake Enable cmake auto tests for -no-gui 2016-03-30 07:16:50 +00:00
compilerwarnings/data Fixed license headers 2015-02-17 18:46:09 +00:00
concurrent Fix problem with exception reporting in QFuture::waitForResult() 2016-08-23 14:55:49 +00:00
corelib QLatin1String: Fix UB (nullptr passed) in relational operators 2016-09-15 10:10:28 +00:00
dbus Fix race condition in tst_QDBusConnection::pendingCallWhenDisconnected 2016-06-06 11:39:53 +00:00
gui Add missing test for QReguarExpression for QTextDocument::findMultiple 2016-09-20 21:23:08 +00:00
guiapplauncher Fix path to examples part of tst_GuiAppLauncher 2015-02-13 07:28:15 +00:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network tst_QSslSocket::setLocalCertificateChain(): fix resource leak when test fail 2016-08-11 04:34:19 +00:00
opengl Merge remote-tracking branch 'origin/5.6.1' into 5.6 2016-06-02 06:01:25 +02:00
other qcompilerdetection.h: retract Q_COMPILER_DEFAULT_MEMBERS for MSVC < 2015 2016-09-03 05:11:40 +00:00
printsupport QMacPrintEngine: Really set the printer resolution 2016-02-25 18:42:47 +00:00
shared Update copyright headers 2015-02-11 06:49:51 +00:00
sql Never return char variants when reading prepared MySQL statements 2016-09-12 12:47:08 +00:00
testlib Major re-write of generate_expected_output.py 2016-08-29 18:02:35 +00:00
tools uic: generate translate calls with Q_NULLPTR instead of 0 2016-09-03 05:07:50 +00:00
widgets tst_QGraphicsItem: Fix UB (invalid cast/member call) in prepareGeometryChange() 2016-09-22 15:25:18 +00:00
xml Fix QDomNamedNodeMap::item crash with negative index 2015-10-29 08:05:45 +00:00
auto.pro Enable cmake auto tests for -no-gui 2016-03-30 07:16:50 +00:00
network-settings.h tst_QTcpSocket, tst_QUdpSocket: Improve diagnostics. 2016-05-02 19:20:33 +00:00
qtest-config.h Update copyright headers 2015-02-11 06:49:51 +00:00
test.pl Update copyright headers 2015-02-11 06:49:51 +00:00