<p>neels has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/21780">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">fix strncpy bug in gprs_ns2_fr_bind()<br><br>This use of strncpy() fails to account for the terminating nul<br>character. Use OSMO_STRLCPY_ARRAY() instead.<br><br>(Interestingly my compiler doesn't complain about this one, though it<br>failed on another similar use of strncpy().)<br><br>Change-Id: Id53e940c7a39ab154966548f4173a179c5bc9151<br>---<br>M src/gb/gprs_ns2_fr.c<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/80/21780/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gb/gprs_ns2_fr.c b/src/gb/gprs_ns2_fr.c</span><br><span>index 6f9cd8d..f6a17ea 100644</span><br><span>--- a/src/gb/gprs_ns2_fr.c</span><br><span>+++ b/src/gb/gprs_ns2_fr.c</span><br><span>@@ -497,7 +497,7 @@</span><br><span>               rc = -EINVAL;</span><br><span>                goto err_priv;</span><br><span>       }</span><br><span style="color: hsl(0, 100%, 40%);">-       strncpy(priv->netif, netif, sizeof(priv->netif));</span><br><span style="color: hsl(120, 100%, 40%);">+       OSMO_STRLCPY_ARRAY(priv->netif, netif);</span><br><span> </span><br><span>       if (result)</span><br><span>          *result = bind;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/21780">change 21780</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/+/21780"/><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: Id53e940c7a39ab154966548f4173a179c5bc9151 </div>
<div style="display:none"> Gerrit-Change-Number: 21780 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>