<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-sip-connector/+/16312">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">mncc.c: fix gsm_mncc_rtp size checks<br><br>Verify is the parsed data is at least the size of the struct, not<br>exactly the size. Make it accept messages with additional data, like<br>the SDP information the TTCN-3 testsuite is sending since<br>Ic9568c8927507e161aadfad1a4d20aa896d8ae30.<br><br>This change makes the size checks consistent with the two other size<br>checks in the file:<br>        if (rc < sizeof(*rtp)) {<br>   if (rc < sizeof(**mncc)) {<br><br>Related: OS#4282<br>Change-Id: I522ce7f206932a816a64f03d916799c3215bb8c7<br>---<br>M src/mncc.c<br>1 file changed, 2 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector refs/changes/12/16312/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/mncc.c b/src/mncc.c</span><br><span>index f2e2579..16eed96 100644</span><br><span>--- a/src/mncc.c</span><br><span>+++ b/src/mncc.c</span><br><span>@@ -472,7 +472,7 @@</span><br><span>    struct call *call;</span><br><span>   struct mncc_call_leg *leg;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  if (rc != sizeof(*data)) {</span><br><span style="color: hsl(120, 100%, 40%);">+    if (rc < sizeof(*data)) {</span><br><span>                 LOGP(DMNCC, LOGL_ERROR, "gsm_mncc of wrong size %d vs. %zu\n",</span><br><span>                     rc, sizeof(*data));</span><br><span>          return close_connection(conn);</span><br><span>@@ -548,7 +548,7 @@</span><br><span> {</span><br><span>    struct mncc_call_leg *leg;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  if (rc != sizeof(**mncc)) {</span><br><span style="color: hsl(120, 100%, 40%);">+   if (rc < sizeof(**mncc)) {</span><br><span>                LOGP(DMNCC, LOGL_ERROR, "gsm_mncc of wrong size %d vs. %zu\n",</span><br><span>                     rc, sizeof(**mncc));</span><br><span>                 close_connection(conn);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-sip-connector/+/16312">change 16312</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-sip-connector/+/16312"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sip-connector </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I522ce7f206932a816a64f03d916799c3215bb8c7 </div>
<div style="display:none"> Gerrit-Change-Number: 16312 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>