<p>Max has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11707">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">SS7: safeguard against wrong number of pointcode component<br><br>Previously internal function get_pc_comp_shift() returned negative error<br>code when called with wrong component number despite unsinged return<br>value which wasn't checked for error anyway.<br><br>Fix this by using explicit assert in the error path. This should not<br>affect external users because this function always called with constant<br>component argument.<br><br>Change-Id: Ib24cdbcf614bad68f3cfa9776a451c5c1e45ae6e<br>---<br>M src/osmo_ss7.c<br>1 file changed, 2 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/07/11707/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c</span><br><span>index 9805b3b..c493672 100644</span><br><span>--- a/src/osmo_ss7.c</span><br><span>+++ b/src/osmo_ss7.c</span><br><span>@@ -198,7 +198,8 @@</span><br><span>         case 2:</span><br><span>              return 0;</span><br><span>    default:</span><br><span style="color: hsl(0, 100%, 40%);">-                return -EINVAL;</span><br><span style="color: hsl(120, 100%, 40%);">+               /* Invalid number of components */</span><br><span style="color: hsl(120, 100%, 40%);">+            OSMO_ASSERT(false);</span><br><span>  }</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11707">change 11707</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/11707"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ib24cdbcf614bad68f3cfa9776a451c5c1e45ae6e </div>
<div style="display:none"> Gerrit-Change-Number: 11707 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Max <msuraev@sysmocom.de> </div>