Attention is currently required from: bucketking657, laforge, pespin.

bucketking657 uploaded patch set #3 to this change.

View Change

The following approvals got outdated and were removed: Code-Review+1 by pespin, Verified+1 by Jenkins Builder

gsm: fix one-byte overflow in BCD number encoders

gsm48_encode_bcd_number() checked only the L octet against max_len,
the size of bcd_lv, but it also writes the L octet itself, so a number
one or two digits over the spec maximum wrote one byte past the buffer.
Count the L octet in the check, and compute the length in an int so
that it cannot wrap. Add tests.

osmo-sgsn passes max_len 8 for the 9-byte IMEISV, which needs
Change-Id Ied06aa05ee6850ec0df34a51cdce6df12e0b594c first.

Fixes: OS#7126
Change-Id: I99521d30896f3d58ecfb28de290bce7e31388fca
---
M src/gsm/gsm48_ie.c
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
M tests/gsm0808/gsm0808_test.c
M tests/gsm0808/gsm0808_test.ok
5 files changed, 140 insertions(+), 3 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/42/44142/3

To view, visit change 44142. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newpatchset
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I99521d30896f3d58ecfb28de290bce7e31388fca
Gerrit-Change-Number: 44142
Gerrit-PatchSet: 3
Gerrit-Owner: bucketking657 <joshuashilts@gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-Attention: pespin <pespin@sysmocom.de>
Gerrit-Attention: laforge <laforge@osmocom.org>
Gerrit-Attention: bucketking657 <joshuashilts@gmail.com>