From da8e9c9d6bcb6464f4d08c26a8b14816de946af0 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 4 Mar 2020 17:11:40 +0100 Subject: [PATCH] MNCC data size check: allow trailing data Verify is the parsed data is at least the size of the struct, not exactly the size. Make it accept messages with additional data, like the SDP information the TTCN-3 testsuite is sending since Ic9568c8927507e161aadfad1a4d20aa896d8ae30. This change makes the size checks consistent with the other size checks in MNCC implementations such as osmo-sip-connector Related: OS#4282 Related: osmo-sip-connector I522ce7f206932a816a64f03d916799c3215bb8c7 Change-Id: Ic8c24e6988ae2d3c4278c4adccae46e248c893b8 --- mncc_sock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mncc_sock.py b/mncc_sock.py index b2d0705..cb10449 100644 --- a/mncc_sock.py +++ b/mncc_sock.py @@ -142,7 +142,7 @@ class MnccSocket(MnccSocketBase): '(0x%04x vs 0x%04x)\n' % (msg.version, mncc.MNCC_SOCK_VERSION)) # Match expected message sizes / offsets - if (msg.mncc_size != ctypes.sizeof(mncc.gsm_mncc) or + if (msg.mncc_size < ctypes.sizeof(mncc.gsm_mncc) or msg.data_frame_size != ctypes.sizeof(mncc.gsm_data_frame) or msg.called_offset != mncc.gsm_mncc.called.offset or msg.signal_offset != mncc.gsm_mncc.signal.offset or