<p>pespin has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21637">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsm_lchan_name: assert on NULL lchan<br><br>Steve Langasek <steve.langasek@ubuntu.com> submitted some patches<br>against downstream osmo-bsc 1.3.0 because some possible null derefences<br>were detected by the compiler on Ubuntu s390x. Code has eveolved since<br>then and patch doesn't apply directly anymore, since related code<br>changed (we now use osmo_count in bsc_subscr_get).<br>The compiled allegedly claimed some null dereference in gsm_lchan_name.<br>In general code using that function seems to be doing checks for<br>existing lchan before calling it, or assuming the lchan pointer is not<br>null, so I couldn't find any major issue.<br>However, let's add a OSMO_ASSERT to make sure we can easily identify the<br>issue if an issue ever happens there, since the gsm_lchan_name should<br>clearly only be called on non null pointers.<br><br>Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387<br>---<br>M include/osmocom/bsc/gsm_data.h<br>1 file changed, 1 insertion(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/37/21637/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h</span><br><span>index 6904266..584c0e6 100644</span><br><span>--- a/include/osmocom/bsc/gsm_data.h</span><br><span>+++ b/include/osmocom/bsc/gsm_data.h</span><br><span>@@ -937,6 +937,7 @@</span><br><span> </span><br><span> static inline char *gsm_lchan_name(const struct gsm_lchan *lchan)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+    OSMO_ASSERT(lchan);</span><br><span>  return lchan->name;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/21637">change 21637</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-bsc/+/21637"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: If4d12cb1d95ee2a89244bb8f27df839871667387 </div>
<div style="display:none"> Gerrit-Change-Number: 21637 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>