lynxis lazus has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/39243?usp=email )


Change subject: gprs_ms_net_cap_gea_mask(): protect against empty MS Network 
Capabilities
......................................................................

gprs_ms_net_cap_gea_mask(): protect against empty MS Network Capabilities

When the MS Network Capability is empty, expect to support at least unecnrypted
communications.
This shouldn't be empty at all.

Change-Id: Ieef2e3eeaaadc90c35fff6f20d47bd36aaa4b9e6
---
M src/sgsn/gprs_gmm.c
1 file changed, 4 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/43/39243/1

diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index 7c1614b..5ed190b 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -1201,6 +1201,10 @@
 static uint8_t gprs_ms_net_cap_gea_mask(const uint8_t *ms_net_cap, uint8_t 
cap_len)
 {
        uint8_t mask = (1 << GPRS_ALGO_GEA0);
+
+       if (cap_len == 0)
+               return mask;
+
        mask |= (0x80 & ms_net_cap[0]) ? (1 << GPRS_ALGO_GEA1) : 0;

        if (cap_len < 2)

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/39243?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ieef2e3eeaaadc90c35fff6f20d47bd36aaa4b9e6
Gerrit-Change-Number: 39243
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <[email protected]>

Reply via email to