pespin submitted this change.

View Change



2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.

Approvals: laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
gsup: Fail decoding if len of PDP Type IE is less than 2 bytes

As documented in gsup.adoc, this field is expected to be 2 bytes.

This is only a intermediate step to showcase the related test scenarios
submitting IE with len > 2. The logic will be changed in a follow-up
patch when changing the IE to also encode/decode the missing Address
part.

Change-Id: I0d024a9a4fb10beeff39ac33a9d2ed02f88f4580
---
M src/gsm/gsup.c
M tests/gsup/gsup_test.err
2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c
index 4e18ddb..2beff4a 100644
--- a/src/gsm/gsup.c
+++ b/src/gsm/gsup.c
@@ -150,6 +150,8 @@
break;

case OSMO_GSUP_PDP_TYPE_IE:
+ if (value_len < 2)
+ return -GMM_CAUSE_PROTO_ERR_UNSPEC;
pdp_info->pdp_type =
osmo_decode_big_endian(value, value_len) & 0x0fff;
break;
diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err
index 7b2fda9..fc3c86e 100644
--- a/tests/gsup/gsup_test.err
+++ b/tests/gsup/gsup_test.err
@@ -164,7 +164,7 @@
message 2: tested 21248 modifications, 2577 parse failures
message 3: tested 2816 modifications, 510 parse failures
message 4: tested 3584 modifications, 770 parse failures
- message 5: tested 20736 modifications, 4025 parse failures
+ message 5: tested 20736 modifications, 4028 parse failures
message 6: tested 3584 modifications, 771 parse failures
message 7: tested 3584 modifications, 770 parse failures
message 8: tested 2816 modifications, 510 parse failures

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I0d024a9a4fb10beeff39ac33a9d2ed02f88f4580
Gerrit-Change-Number: 35624
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged