diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-01-19 09:13:05 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-01-20 16:13:17 +0100 |
commit | 2585620857a3a6c17b17a65a3d9a863824b8e401 (patch) | |
tree | 96fa6e4d018cbe51e71ebf5471e2d44db871302c | |
parent | 6be9ffa3b811311043194d04ae06e05d216c57bb (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.c | 2 |
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); |