Change in ...libosmocore[master]: gsm48_decode_bcd_number2: fix ENOSPC edge case

osmith gerrit-no-reply at lists.osmocom.org
Fri Jun 7 08:59:25 UTC 2019


Hello fixeria, pespin, daniel, Jenkins Builder, 

I'd like you to reexamine a change. Please visit

    https://gerrit.osmocom.org/c/libosmocore/+/14397

to look at the new patch set (#3).

Change subject: gsm48_decode_bcd_number2: fix ENOSPC edge case
......................................................................

gsm48_decode_bcd_number2: fix ENOSPC edge case

Return ENOSPC if the decoding buffer is one byte to small, instead of
returning 0 and silently truncating the string. Add a new "truncated"
variable to detect if the loop breaks in the final iteration.

The string is not truncated if there is exactly one 0xf ('\0') higher
nibble remaining. This is covered by the existing test case "long
15-digit (maximum) MSISDN, limited buffer".

(This commit has just the new test, without the fix, to prove that 0 is
returned instead of -ENOSPC.)

Related: OS#4049
Change-Id: Ie05900aca50cc7fe8a45d17844dbfcd905fd82fe
---
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
2 files changed, 15 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/14397/3
-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/14397
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ie05900aca50cc7fe8a45d17844dbfcd905fd82fe
Gerrit-Change-Number: 14397
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newpatchset
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190607/a1526d43/attachment.html>


More information about the gerrit-log mailing list