aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Kluchnikov <kluchnikovi@gmail.com>2017-05-16 19:37:47 +0300
committerIvan Kluchnikov <kluchnikovi@gmail.com>2017-05-16 19:37:47 +0300
commit0e282735509e24ee360876adaafe45992816b5df (patch)
tree5dcfc32b3c0630c15f7e4193ff41e0f3af92138f
parent0e883ba6d412db09140445dff0f425247a6c7039 (diff)
ussd: Avoid crashing when no connection is present in the transaction
If we get a ussd response for transaction, but there is no connection for this transaction, we will now complain, delete the message and return.
-rw-r--r--openbsc/src/libmsc/ussd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c
index 23adfeef1..604c686d3 100644
--- a/openbsc/src/libmsc/ussd.c
+++ b/openbsc/src/libmsc/ussd.c
@@ -218,6 +218,13 @@ int on_ussd_response(struct gsm_network *net,
msgb_put(msg, reqhdr->component_length);
ssrep.transaction_id = (trans->transaction_id << 4) ^ 0x80;
+
+ if (!trans->conn) {
+ DEBUGP(DSS, "No connection for transaction with id: %d\n",
+ trans->transaction_id);
+ msgb_free(msg);
+ return -1;
+ }
rc = gsm0480_send_component(trans->conn, msg, &ssrep);
if (reqhdr->message_type == GSM0480_MTYPE_RELEASE_COMPLETE) {