aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2020-05-10 22:43:03 +0300
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2020-05-11 00:33:05 +0300
commit169c229d27edae2ed859733564a76dc75c8526c1 (patch)
tree8b5124291bc7b0e243d2510947c58885764ddac7
parent0ae129e9f0d8a632c1d02cde0d26697b751a35b2 (diff)
stats: Only dereference a connection pointer after checking for NULL.
Addresses CID 210261. Change-Id: Ic7e7c92c5b9ff696fa7f4cd0d69451cd22333f71
-rw-r--r--src/osmo-bsc/osmo_bsc_bssap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index f1e43be5a..b92e39acd 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -1104,7 +1104,7 @@ static int dtap_rcvmsg(struct gsm_subscriber_connection *conn,
struct msgb *gsm48;
uint8_t *data;
int rc, dtap_rc;
- struct rate_ctr *ctrs = conn->sccp.msc->msc_ctrs->ctr;
+ struct rate_ctr *ctrs;
LOGP(DMSC, LOGL_DEBUG, "Rx MSC DTAP: %s\n",
osmo_hexdump(msg->l3h, length));
@@ -1114,6 +1114,7 @@ static int dtap_rcvmsg(struct gsm_subscriber_connection *conn,
return -1;
}
+ ctrs = conn->sccp.msc->msc_ctrs->ctr;
header = (struct dtap_header *) msg->l3h;
if (sizeof(*header) >= length) {
rate_ctr_inc(&ctrs[MSC_CTR_BSSMAP_RX_DTAP_ERROR]);