diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-03-12 11:34:48 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-03-15 10:39:16 +0000 |
commit | 52a599bb56e5e5e625909c25edee8487b0a3754d (patch) | |
tree | 2dd362d8690ffdc21626d930b0f6023203693157 /tests | |
parent | 1a9e1fbbfc96b84bf96927b3573a6528bffc98a5 (diff) |
QCosmeticStroker: fix several UBs involving << with a negative LHS
Left-shifts of negative values are undefined in C++. In particular,
they don't behave arithmetically.
Reported by UBSan:
qcosmeticstroker.cpp: 72:15: runtime error: left shift of negative value -14/-19/-32/-33/-34/-37/-38/-63/-64/-192/-384/-1280
qcosmeticstroker.cpp:444:20: runtime error: left shift of negative value -64
qcosmeticstroker.cpp:451:26: runtime error: left shift of negative value -1
qcosmeticstroker.cpp:483:26: runtime error: left shift of negative value -1
qcosmeticstroker.cpp:762:20: runtime error: left shift of negative value -64
qcosmeticstroker.cpp:774:26: runtime error: left shift of negative value -1
qcosmeticstroker.cpp:813:47: runtime error: left shift of negative value -1
qcosmeticstroker.cpp:839:20: runtime error: left shift of negative value -64
qcosmeticstroker.cpp:851:26: runtime error: left shift of negative value -1
qcosmeticstroker.cpp:889:47: runtime error: left shift of negative value -1
qcosmeticstroker.cpp:932:27: runtime error: left shift of negative value -64
qcosmeticstroker.cpp:995:27: runtime error: left shift of negative value -3/-64
Fix by using ordinary multiplication instead, because negative
left-hand-side values don't look like they are an error.
Change-Id: Icbebd41f6ddd3dca4abd385585fc0f82064fe8b6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions