summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qdatastream.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2025-01-28 03:11:58 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2025-01-29 20:05:07 +0100
commit45e90b73c75b2c7997a0f8d750f9927f64e05a0e (patch)
treef046b59f1fc8233526e8be8c3c75e13ccc431d6f /src/corelib/serialization/qdatastream.cpp
parent15154fa4c5d216b1c943a3b37be24f5fb2e4fa73 (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