<p>dexter has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/13547">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsm_utils: fix use buf_len instead of sizeof() osmo_dump_gsmtime_buf<br><br>The function osmo_dump_gsmtime_buf gets a pointer *buf and a parameter<br>buf_len. The pointer *buf is a string buffer and the function places an<br>\0 at the end of the buffer before it exists. However it uses<br>sizeof(buf) as part of the index calculation, which is incorrect. Lets<br>correct this by using buf_len instead.<br><br>Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114<br>---<br>M src/gsm/gsm_utils.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/47/13547/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c</span><br><span>index f34d9ea..f2bf57b 100644</span><br><span>--- a/src/gsm/gsm_utils.c</span><br><span>+++ b/src/gsm/gsm_utils.c</span><br><span>@@ -890,7 +890,7 @@</span><br><span> {</span><br><span>        snprintf(buf, buf_len, "%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8,</span><br><span>            tm->fn, tm->t1, tm->t2, tm->t3, (uint8_t)tm->fn%52);</span><br><span style="color: hsl(0, 100%, 40%);">-    buf[sizeof(buf)-1] = '\0';</span><br><span style="color: hsl(120, 100%, 40%);">+    buf[buf_len-1] = '\0';</span><br><span>       return buf;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/13547">change 13547</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/13547"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114 </div>
<div style="display:none"> Gerrit-Change-Number: 13547 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>