summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2016-01-06 12:51:02 +0100
committerMarc Mutz <marc.mutz@kdab.com>2016-01-06 17:25:05 +0000
commit033205bb598fe49e6ca4c90fb4e046e996c20252 (patch)
tree5329c7d6edd4db20ade0526beb6cfcc713124b61 /examples
parent4f48c3a309a6b055ef5293e9d6c1a9a442eb65e2 (diff)
Fix UB in tst_QIODevice::getSetCheck()
The reinterpret cast from a QTcpSocket → QAbstractSocket → QIODevice to MyIODevice → QIODevice was undefined. Fix by simply instantiating a MyIODevice, which must then inherit from QTcpSocket, of course. Instead of fixing the class name in the overridden setOpenMode() method, simply make the base class' implementation public with a using declaration. Found by UBSan: qtbase/tests/auto/corelib/io/qiodevice/tst_qiodevice.cpp:84:22: runtime error: member call on address 0x7ffcca2d23f0 which does not point to an object of type 'MyIODevice' 0x7ffcca2d23f0: note: object is of type 'QTcpSocket' Change-Id: I939b3548949b9b5765df4a6cc81875e169fd69dd Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions