mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-07-29 05:24:18 -04:00
d44a953cfa
Change the ft8_crc message length parameter from signed int to uint32_t
since it represents a non-negative FT8 message bit count.
GCC reported a potential buffer overflow in the memcpy() call:
warning: ‘__builtin_memcpy’ specified bound between
18446744073709551560 and 18446744073709551564 exceeds maximum object size
[-Wstringop-overflow=]
The warning was caused by the signed message length allowing negative
values to be converted into a very large unsigned size when calculating
the memcpy() byte count.
Using an unsigned fixed-width type better represents the valid range of
the FT8 message length and prevents invalid negative lengths from being
interpreted as extremely large memory operations.
Signed-off-by: Robin Getz <rgetz503@gmail.com>