<p>Neels Hofmeyr <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/12151">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">gsm0408_test: test encoding and decoding Mobile Identity<br><br>One would think by now we would solidly encode and decode Mobile Identities.<br>Well, guess again.<br><br>- rc is sometimes the amount of bytes written, sometimes actual strlen().<br><br>- on string truncation, rc is sometimes strlen() (assuming nul terminated), and<br>  sometimes snprintf()-style would-be strlen().<br><br>- returned string, when truncated by not enough buffer size, is sometimes nul<br>  terminated, sometimes not.<br><br>- gsm48_mi_to_string() happily reads a byte from zero-length input buffer.<br><br>- gsm48_mi_to_string() happily writes to zero length output buffer.<br><br>- gsm48_mi_to_string() returns nonempty string for empty input.<br><br>- encoding a MI type that still has the GSM_MI_ODD flag set results in encoding<br>  an even-length MI as odd-length (hence appending a stray 'F').<br><br>I am going to tweak the implementation of gsm48 mobile identity encoding /<br>decoding, so first pinpoint the current behavior in a unit test, and show how<br>perforated even such a seemingly trivial API can be.<br><br>Change-Id: Iaae3af87f82f1a8f2e6273984c011b2813038cf7<br>---<br>M tests/gsm0408/gsm0408_test.c<br>M tests/gsm0408/gsm0408_test.ok<br>2 files changed, 358 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/51/12151/4</pre><p>To view, visit <a href="https://gerrit.osmocom.org/12151">change 12151</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/12151"/><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: Iaae3af87f82f1a8f2e6273984c011b2813038cf7 </div>
<div style="display:none"> Gerrit-Change-Number: 12151 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>
<div style="display:none"> Gerrit-Reviewer: Pau Espin Pedrol <pespin@sysmocom.de> </div>