From a9e586cb87705d65f3a3d5903806d222277462be Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 21 Dec 2015 22:21:30 +0100 Subject: Add range checks in ESTn EDI Tag --- src/dabOutput/edi/TagItems.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/dabOutput') diff --git a/src/dabOutput/edi/TagItems.cpp b/src/dabOutput/edi/TagItems.cpp index afc45a8..1ea7080 100644 --- a/src/dabOutput/edi/TagItems.cpp +++ b/src/dabOutput/edi/TagItems.cpp @@ -145,6 +145,17 @@ std::vector TagESTn::Assemble() packet.push_back(0); packet.push_back(0); + if (tpl > 0x3F) { + throw std::runtime_error("TagESTn: invalid TPL value"); + } + + if (sad > 0x3FF) { + throw std::runtime_error("TagESTn: invalid SAD value"); + } + + if (scid > 0x3F) { + throw std::runtime_error("TagESTn: invalid SCID value"); + } uint32_t sstc = (scid << 18) | (sad << 8) | (tpl << 2) | rfa; packet.push_back((sstc >> 16) & 0xFF); -- cgit v1.2.3