From ce18705875a0ce7314b77f39f753f6a62a09b1e6 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Fri, 23 Jul 2021 10:58:19 +0200 Subject: [PATCH] mgcp_protocol: assert endp when it becomes mandatory The logic when an endp pointer is guranteed and when we are able to process the request without the endp pointer populated is qute complex. This shows up as a bug to coverity. Change-Id: I1d4221f2df13c43321d5466534485cf21f0d9010 Fixes: CID#237088 --- src/libosmo-mgcp/mgcp_protocol.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index aef41e09c..e69c00f1f 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1467,6 +1467,10 @@ static struct msgb *handle_delete_con(struct mgcp_request_data *rq) return create_ok_response(NULL, 200, "DLCX", pdata->trans); } + /* The logic does not permit to go past this point without having the + * the endp pointer populated. */ + OSMO_ASSERT(endp); + /* When no connection id is supplied, we will interpret this as a * wildcarded DLCX that refers to the selected endpoint. This means * that we drop all connections on that specific endpoint at once.