1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-06 19:06:30 -04:00
Commit Graph

6 Commits

Author SHA1 Message Date
Robin Getz 742746dc7b Fix undefined shift in SimpleDeserializer::readS32
The signed integer deserialization code used a signed temporary value while
assembling bytes:

    tmp = (tmp << 8) | byte;

For negative values, tmp was initialized to -1 for sign extension, causing a
left shift of a negative value, which is undefined behavior in C++.

Use an unsigned temporary while constructing the 32-bit representation and
convert to qint32 only after all bytes have been assembled. This preserves the
existing two's complement sign handling while avoiding undefined signed shifts.

Fixes static analysis (cppcheck) warning about shifting a negative value.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 15:01:21 -04:00
f4exb 439b5d094c Rewriting of copyright notices for sdrbase. Part of #1893 2023-11-19 13:43:10 +01:00
John Greb 836796fff4 Strict aliasing. 2014-11-22 21:55:35 +00:00
John Greb 3717af3f43 Quiet more warnings. 2014-11-21 19:44:19 +00:00
John Greb ec14645130 Comment out harmless Compiler warning. 2014-10-23 22:19:54 +01:00
Hexameron 7d3bfb26fc git clone git://git.osmocom.org/sdrangelove.git 2014-05-18 16:52:39 +01:00