<p>Harald Welte <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/12643">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Work around bogus gcc-8.2 array-bounds warning/error<br><br>gcc-8.2 is printing the following warning, which is an error<br>when used -Werror like our --enable-werror:<br><br>In file included from gprs_bssgp.c:34:<br>In function ‘tl16v_put’,<br>    inlined from ‘tvlv_put.part.3’ at ../../include/osmocom/gsm/tlv.h:156:9,<br>    inlined from ‘tvlv_put’ at ../../include/osmocom/gsm/tlv.h:147:24,<br>    inlined from ‘msgb_tvlv_push’ at ../../include/osmocom/gsm/tlv.h:386:2,<br>    inlined from ‘bssgp_tx_dl_ud’ at gprs_bssgp.c:1162:4:<br>../../include/osmocom/gsm/tlv.h:131:2: error: ‘memcpy’ forming offset [12, 130] is out of the bounds [0, 11] of object ‘mi’ with type ‘uint8_t[11]’ {aka ‘unsigned char[11]’} [-Werror=array-bounds]<br>  memcpy(buf, val, len);<br><br>Where "130" seems to be the maximum value of uint8_t, shifted right one +<br>2.  But even as we use strnlen() with "16" as maximum upper bound, gcc<br>still believes there's a way that the return value of gsm48_generate_mid_from_imsi()<br>could be 130.  In fact, even the newly-added OSMO_ASSERT() inside<br>gsm48_generate_mid() doesn't help and gcc still insists there is a problem :(<br><br>Change-Id: I0a06daa19b7b5b5badbb8b3d81a54c45b88a60ec<br>---<br>M src/gb/gprs_bssgp.c<br>M src/gb/gprs_bssgp_bss.c<br>2 files changed, 21 insertions(+), 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/43/12643/2</pre><p>To view, visit <a href="https://gerrit.osmocom.org/12643">change 12643</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/12643"/><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: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I0a06daa19b7b5b5badbb8b3d81a54c45b88a60ec </div>
<div style="display:none"> Gerrit-Change-Number: 12643 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>