<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-pcu/+/14923">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gprs_bssgp_pcu.cpp: check return code of gsm48_mi_to_string()<br><br>Change-Id: Id1ad279ce9bef38eb3d11ac62337276207e8d8bd<br>---<br>M src/gprs_bssgp_pcu.cpp<br>1 file changed, 14 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/23/14923/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp</span><br><span>index 3ea3e59..730176a 100644</span><br><span>--- a/src/gprs_bssgp_pcu.cpp</span><br><span>+++ b/src/gprs_bssgp_pcu.cpp</span><br><span>@@ -93,6 +93,7 @@</span><br><span> char imsi[16] = "000";</span><br><span> uint8_t ms_class = 0;</span><br><span> uint8_t egprs_ms_class = 0;</span><br><span style="color: hsl(120, 100%, 40%);">+ int rc;</span><br><span> #if 0</span><br><span> MS_Radio_Access_capability_t rac;</span><br><span> #endif</span><br><span>@@ -120,8 +121,12 @@</span><br><span> * will listen to all paging blocks. */</span><br><span> if (TLVP_PRESENT(tp, BSSGP_IE_IMSI))</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- gsm48_mi_to_string(imsi, sizeof(imsi), TLVP_VAL(tp, BSSGP_IE_IMSI),</span><br><span style="color: hsl(0, 100%, 40%);">- TLVP_LEN(tp, BSSGP_IE_IMSI));</span><br><span style="color: hsl(120, 100%, 40%);">+ rc = gsm48_mi_to_string(imsi, sizeof(imsi), TLVP_VAL(tp, BSSGP_IE_IMSI),</span><br><span style="color: hsl(120, 100%, 40%);">+ TLVP_LEN(tp, BSSGP_IE_IMSI));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (rc) {</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGP(DBSSGP, LOGL_NOTICE, "BSSGP TLLI=0x%08x Failed to parse IMSI IE\n", tlli);</span><br><span style="color: hsl(120, 100%, 40%);">+ return bssgp_tx_status(BSSGP_CAUSE_COND_IE_ERR, NULL, msg);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> }</span><br><span> </span><br><span> #if 0 /* Do not rely on this IE. TODO: make this configurable */</span><br><span>@@ -172,6 +177,7 @@</span><br><span> char imsi[16];</span><br><span> uint8_t *ptmsi = (uint8_t *) TLVP_VAL(tp, BSSGP_IE_TMSI);</span><br><span> uint16_t ptmsi_len = TLVP_LEN(tp, BSSGP_IE_TMSI);</span><br><span style="color: hsl(120, 100%, 40%);">+ int rc;</span><br><span> </span><br><span> LOGP(DBSSGP, LOGL_NOTICE, " P-TMSI = ");</span><br><span> for (int i = 0; i < ptmsi_len; i++)</span><br><span>@@ -185,7 +191,12 @@</span><br><span> return -EINVAL;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">- gsm48_mi_to_string(imsi, sizeof(imsi), TLVP_VAL(tp, BSSGP_IE_IMSI), TLVP_LEN(tp, BSSGP_IE_IMSI));</span><br><span style="color: hsl(120, 100%, 40%);">+ rc = gsm48_mi_to_string(imsi, sizeof(imsi), TLVP_VAL(tp, BSSGP_IE_IMSI),</span><br><span style="color: hsl(120, 100%, 40%);">+ TLVP_LEN(tp, BSSGP_IE_IMSI));</span><br><span style="color: hsl(120, 100%, 40%);">+ if (rc) {</span><br><span style="color: hsl(120, 100%, 40%);">+ LOGP(DBSSGP, LOGL_NOTICE, "Failed to parse IMSI IE\n");</span><br><span style="color: hsl(120, 100%, 40%);">+ return bssgp_tx_status(BSSGP_CAUSE_COND_IE_ERR, NULL, msg);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span> </span><br><span> return gprs_rlcmac_paging_request(ptmsi, ptmsi_len, imsi);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-pcu/+/14923">change 14923</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-pcu/+/14923"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: osmo-pcu </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id1ad279ce9bef38eb3d11ac62337276207e8d8bd </div>
<div style="display:none"> Gerrit-Change-Number: 14923 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>