From 4f791a8f09472ffac7df1c7e8a12de52f80082b1 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Mon, 23 Dec 2024 12:40:57 +0100 Subject: [PATCH] M17: FrameDecoder: decodeLich: added validation of LICH chunk number --- openrtx/src/protocols/M17/M17FrameDecoder.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openrtx/src/protocols/M17/M17FrameDecoder.cpp b/openrtx/src/protocols/M17/M17FrameDecoder.cpp index c35a2643..1c6685f0 100644 --- a/openrtx/src/protocols/M17/M17FrameDecoder.cpp +++ b/openrtx/src/protocols/M17/M17FrameDecoder.cpp @@ -202,8 +202,12 @@ bool M17FrameDecoder::decodeLich(std::array < uint8_t, 6 >& segment, } // Last byte of the segment contains the segment number, shift left - // by five when packing the LICH. + // by five when packing the LICH. The segment number must range between + // zero and five. segment[5] >>= 5; + if(segment[5] > 5) + return false; + return true; }