summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-27 11:48:15 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-27 11:48:15 +0200
commit4c880a02f4186406a53ce7fa28b061ce3a0d3955 (patch)
treed0902b3a7b142976b64ddf67a1032351074d1ffc
parent48c720bffc8de73cee654541927a9c0f63a2412b (diff)
osmo_sccp_user_sap_down(): Avoid uninitialized pointer deref
When receiving an unknown primitive, we end up de-referencing an unassigned/uninitialized pointer for 'conn'. Let's properly catch that case and print an error message. Change-Id: Id1f5f293ea9bce8601d45164be670a7062d91802 Fixes: coverity CID#166947
-rw-r--r--src/sccp_scoc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c
index 6d9916b..3a52ca6 100644
--- a/src/sccp_scoc.c
+++ b/src/sccp_scoc.c
@@ -1628,6 +1628,11 @@ int osmo_sccp_user_sap_down(struct osmo_sccp_user *scu, struct osmo_prim_hdr *op
goto out;
}
break;
+ default:
+ LOGP(DLSCCP, LOGL_ERROR, "Received unknown primitive %s\n",
+ osmo_scu_prim_name(&prim->oph));
+ rc = -1;
+ goto out;
}
/* Map from primitive to event */