diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-01-06 13:50:56 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-01-11 18:16:31 +0000 |
commit | 71ea41f999c1dbe83cba2491f5ac99d6c5a3d98c (patch) | |
tree | 8f89d4640941b93232216f942f5104d2a822004c /header.LGPL3-COMM | |
parent | c8af3160d2514fb973a0d00d5bac324d4f7159f7 (diff) |
Fix UB in QVariant::canConvert()
'currentType' was not sanitized before being used as a shift.
Fix by checking for a valid shift amount before shifting.
Also change the shifted value from 1 (int) to 1U (uint).
It's just the right thing to do.
Found by UBSan:
qtbase/src/corelib/kernel/qvariant.cpp:3131:59: runtime error: shift exponent 1114 is too large for 32-bit type 'unsigned int'
Change-Id: Id3910d6d7f166fd7c80adf5ce1699f0eeb453562
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'header.LGPL3-COMM')
0 files changed, 0 insertions, 0 deletions