aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-19 09:13:05 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-01-19 15:10:57 +0100
commit870f7c20e1af47129ab055b72c288919cb89f6fc (patch)
tree96fa6e4d018cbe51e71ebf5471e2d44db871302c
parent3793b21a42a3e33c0356a59d3153988bc40c7820 (diff)
sgsn: Fix access to subscr in sgsn_auth_update (Coverity)
Currently the access to subscr->sgsn_data->error_cause is not protected against subscr == NULL like it is done in other code paths of sgsn_auth_update. This commit adds a conditional to avoid a NULL-dereference. Fixes: Coverity CID 1264589 Sponsored-by: On-Waves ehf
-rw-r--r--openbsc/src/gprs/sgsn_auth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsc/src/gprs/sgsn_auth.c b/openbsc/src/gprs/sgsn_auth.c
index 9f526dcc1..41f7c4157 100644
--- a/openbsc/src/gprs/sgsn_auth.c
+++ b/openbsc/src/gprs/sgsn_auth.c
@@ -257,7 +257,7 @@ void sgsn_auth_update(struct sgsn_mm_ctx *mmctx)
gsm0408_gprs_access_granted(mmctx);
break;
case SGSN_AUTH_REJECTED:
- gmm_cause = subscr->sgsn_data->error_cause;
+ gmm_cause = subscr ? subscr->sgsn_data->error_cause : 0;
if (subscr && (subscr->flags & GPRS_SUBSCRIBER_CANCELLED) != 0)
gsm0408_gprs_access_cancelled(mmctx, gmm_cause);