From 1261db15058cfa94615f26c1083bb8a38d09218b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 28 Jul 2018 21:37:06 +0200 Subject: 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 --- src/gsm/ipa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gsm') diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index d423c262..b6fdc985 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -128,7 +128,7 @@ int ipa_ccm_idtag_parse_off(struct tlv_parsed *dec, unsigned char *buf, int len, 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; -- cgit v1.2.3