<p>Vadim Yanitskiy has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/18619">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bts_features: fix: properly check the result of bitvec_get_bit_pos()<br><br>If a feature index does not fit to the feature vector, this<br>function would return a negative number that would be casted<br>to true. This is wrong, we should return false instead.<br><br>Change-Id: Id1ad92e7654a806bb920ae9507c88a122e8d09f0<br>---<br>M include/osmocom/gsm/bts_features.h<br>1 file changed, 1 insertion(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/19/18619/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/gsm/bts_features.h b/include/osmocom/gsm/bts_features.h</span><br><span>index 7ead020..6ab8f62 100644</span><br><span>--- a/include/osmocom/gsm/bts_features.h</span><br><span>+++ b/include/osmocom/gsm/bts_features.h</span><br><span>@@ -40,5 +40,5 @@</span><br><span> static inline bool osmo_bts_has_feature(const struct bitvec *features, enum osmo_bts_features feature)</span><br><span> {</span><br><span>        OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES);</span><br><span style="color: hsl(0, 100%, 40%);">-       return bitvec_get_bit_pos(features, feature);</span><br><span style="color: hsl(120, 100%, 40%);">+ return bitvec_get_bit_pos(features, feature) == ONE;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/18619">change 18619</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/libosmocore/+/18619"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Id1ad92e7654a806bb920ae9507c88a122e8d09f0 </div>
<div style="display:none"> Gerrit-Change-Number: 18619 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Vadim Yanitskiy <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>