osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sip-connector/+/16423 )


Change subject: mncc.c: fix gsm_mncc_rtp size checks
......................................................................

mncc.c: fix gsm_mncc_rtp size checks

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 two other size
checks in the file:
        if (rc < sizeof(*rtp)) {
        if (rc < sizeof(**mncc)) {

This is the same patch as I522ce7f206932a816a64f03d916799c3215bb8c7, but
with a different Change-Id, so I can push it together with a release tag
to gerrit. We'll create a new release with this patch on top of the last
release, so all TTCN-3 tests are passing for latest again (less effort
than adding a second code path for the old version in the testsuite).

Related: OS#4282
Change-Id: I9fc71bb6fa946ff4f0934de85e5ec29b8dd67b7f
---
M src/mncc.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/23/16423/1

diff --git a/src/mncc.c b/src/mncc.c
index f5a44d5..2230574 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -458,7 +458,7 @@
        struct call *call;
        struct mncc_call_leg *leg;

-       if (rc != sizeof(*data)) {
+       if (rc < sizeof(*data)) {
                LOGP(DMNCC, LOGL_ERROR, "gsm_mncc of wrong size %d vs. %zu\n",
                        rc, sizeof(*data));
                return close_connection(conn);
@@ -534,7 +534,7 @@
 {
        struct mncc_call_leg *leg;

-       if (rc != sizeof(**mncc)) {
+       if (rc < sizeof(**mncc)) {
                LOGP(DMNCC, LOGL_ERROR, "gsm_mncc of wrong size %d vs. %zu\n",
                        rc, sizeof(**mncc));
                close_connection(conn);

--
To view, visit https://gerrit.osmocom.org/c/osmo-sip-connector/+/16423
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I9fc71bb6fa946ff4f0934de85e5ec29b8dd67b7f
Gerrit-Change-Number: 16423
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osm...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to