Change in libosmocore[master]: ipa_ccm_idtag_parse*: Fix reported length value

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Mar 19 13:41:49 UTC 2019


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/10216 )

Change subject: ipa_ccm_idtag_parse*: Fix reported length value
......................................................................

ipa_ccm_idtag_parse*: Fix reported length value

IPA CCM is using a somewhat weird TLV encoding scheme:
* 16bit length (of tag and value)
* 8bit tag
* value

Our existing code mapping the CCM to 'struct tlv_parse' used the plain
length value without accounting for the one-byte tag.

This patch ensures we only report the length of the "value" part,
excluding the tag.

Change-Id: I435aaa33605bd48635715a2c81aa2d231c1abf51
---
M src/gsm/ipa.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Neels Hofmeyr: Looks good to me, but someone else must approve
  Max: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c
index d423c26..b6fdc98 100644
--- a/src/gsm/ipa.c
+++ b/src/gsm/ipa.c
@@ -128,7 +128,7 @@
 
 		DEBUGPC(DLMI, "%s='%s' ", ipa_ccm_idtag_name(t_tag), cur);
 
-		dec->lv[t_tag].len = t_len - len_offset;
+		dec->lv[t_tag].len = t_len - 1 - len_offset;
 		dec->lv[t_tag].val = cur;
 
 		cur += t_len - len_offset;

-- 
To view, visit https://gerrit.osmocom.org/10216
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I435aaa33605bd48635715a2c81aa2d231c1abf51
Gerrit-Change-Number: 10216
Gerrit-PatchSet: 4
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Assignee: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190319/da87f27e/attachment.html>


More information about the gerrit-log mailing list