mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-20 12:45:40 -05:00
M17: Packet Decode Fix Sanity Check So It Doesn't Break CRC;
This commit is contained in:
@@ -3379,9 +3379,12 @@ void processM17PKT(dsd_opts * opts, dsd_state * state)
|
|||||||
//sanity check to we don't go out of bounds on memcpy and total (core dump)
|
//sanity check to we don't go out of bounds on memcpy and total (core dump)
|
||||||
if (ptr > 825) ptr = 825;
|
if (ptr > 825) ptr = 825;
|
||||||
if (ptr < 0) ptr = 0;
|
if (ptr < 0) ptr = 0;
|
||||||
if (ptr == 0 && eot == 1) ptr = 3; //this is from a bad decode, and caused a core dump on total being a negative value
|
|
||||||
|
|
||||||
int total = ptr + counter - 3; //-3 if changes to M17_Implementations are made
|
int total = ptr + counter - 3; //-3 if changes to M17_Implementations are made
|
||||||
|
|
||||||
|
//sanity check on total
|
||||||
|
if (total < 0 && eot == 1) total = 0; //this is from a bad decode, and caused a core dump on total being a negative value
|
||||||
|
|
||||||
int end = ptr + 25;
|
int end = ptr + 25;
|
||||||
|
|
||||||
//TODO: Fix this
|
//TODO: Fix this
|
||||||
|
|||||||
Reference in New Issue
Block a user