1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-04 18:06:22 -04:00
Files
sdrangel/sdrbase/util
Robin Getz 1330a0639d Fix undefined left shift in SimpleDeserializer::readS64
The signed 64-bit 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. Left-shifting
this negative value is undefined behavior in C++.

Use an unsigned temporary while constructing the 64-bit representation and
convert to qint64 after all bytes have been assembled. This preserves the
existing two's complement sign handling while avoiding undefined behavior.

Fixes static analysis warning about shifting a negative value.

Signed-off-by: Robin Getz <rgetz503@gmail.com>
2026-08-01 15:10:48 -04:00
..
2024-09-05 13:37:46 +03:00
2024-07-10 23:06:38 +02:00
2024-07-10 23:06:38 +02:00
2026-07-09 23:16:19 +01:00
2024-07-10 23:06:38 +02:00
2024-07-10 23:06:38 +02:00
2024-06-10 14:01:57 +01:00
2024-07-10 23:06:38 +02:00
2025-06-04 18:15:59 +01:00
2025-06-04 18:15:59 +01:00
2026-03-25 16:30:13 +00:00
2025-06-04 20:24:58 +01:00
2025-06-04 20:24:58 +01:00
2024-03-03 13:40:42 +00:00
2024-10-11 11:01:43 +01:00
2024-10-11 11:01:43 +01:00
2024-03-14 15:41:01 +00:00
2024-07-10 23:06:38 +02:00
2024-06-10 14:01:57 +01:00
2024-07-10 23:06:38 +02:00
2026-07-19 17:16:04 +01:00
2026-07-19 17:16:04 +01:00
2026-03-25 16:30:13 +00:00
2026-03-25 18:58:43 +00:00
2025-06-04 20:22:09 +01:00
2025-06-04 20:22:09 +01:00
2024-07-10 23:06:38 +02:00
2026-03-26 21:34:07 +00:00
2024-10-08 22:19:29 +01:00
2024-03-03 13:57:10 +00:00
2024-07-10 23:06:38 +02:00
2026-02-01 17:15:47 +01:00
2026-02-01 17:15:47 +01:00
2024-04-04 21:41:07 +01:00
2024-07-10 23:06:38 +02:00
2025-06-09 11:12:46 +01:00