<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/12482">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">paging: fix nullpointer deref<br><br>In theroy the finction T_def_get_entry() may return a nullpointer. In<br>this case we would run straight into a nullpointer dereference problem.<br>However, the requested timer is statically defined and should always be<br>there. However Coverity still reports this as a problem. Lets put an<br>OSMO_ASSERT to make clear that there is no problem here.<br><br>Fixes: CID#190403<br>Change-Id: If5238132d9d5a1507b9955a0b2dc4b1bced220e8<br>---<br>M src/osmo-bsc/paging.c<br>1 file changed, 5 insertions(+), 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/82/12482/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/osmo-bsc/paging.c b/src/osmo-bsc/paging.c</span><br><span>index 2c9d5cd..066db1c 100644</span><br><span>--- a/src/osmo-bsc/paging.c</span><br><span>+++ b/src/osmo-bsc/paging.c</span><br><span>@@ -296,6 +296,11 @@</span><br><span>      unsigned int to_us, to;</span><br><span>      struct T_def *d = T_def_get_entry(bts->network->T_defs, 3113);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+      /* Note: d should always contain a valid pointer since all timers,</span><br><span style="color: hsl(120, 100%, 40%);">+     * including 3113 are statically pre-defined in</span><br><span style="color: hsl(120, 100%, 40%);">+        * struct T_def gsm_network_T_defs. */</span><br><span style="color: hsl(120, 100%, 40%);">+        OSMO_ASSERT(d);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>    if (!bts->T3113_dynamic)</span><br><span>          return d->val;</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/12482">change 12482</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/12482"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: If5238132d9d5a1507b9955a0b2dc4b1bced220e8 </div>
<div style="display:none"> Gerrit-Change-Number: 12482 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>