diff options
| author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2025-01-28 03:11:58 +0100 |
|---|---|---|
| committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2025-01-29 20:05:07 +0100 |
| commit | 45e90b73c75b2c7997a0f8d750f9927f64e05a0e (patch) | |
| tree | f046b59f1fc8233526e8be8c3c75e13ccc431d6f /src/corelib/serialization/qdatastream.cpp | |
| parent | 15154fa4c5d216b1c943a3b37be24f5fb2e4fa73 (diff) | |
QDateTime: prevent signed integer overflow
While the code checks for the possibility that leftMillis-rightMillis
may overflow, it fails to take into account that the result may be
minimal ("INT64_MIN", so to speak) and passes it to qAbs, triggering UB
in there. Since it's just a range check and we don't need the result to
be signed, use qUnsignedAbs.
Change-Id: I7f1a4bbc521fdc164ca20fedf0e995359a67ea4d
Pick-to: 6.9 6.8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/serialization/qdatastream.cpp')
0 files changed, 0 insertions, 0 deletions
