Change in osmo-mgw[master]: mgcp_client_vty: add OSMO_ASSERT on pool parameter

laforge gerrit-no-reply at lists.osmocom.org
Thu Aug 19 14:47:35 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/25208 )

Change subject: mgcp_client_vty: add OSMO_ASSERT on pool parameter
......................................................................

mgcp_client_vty: add OSMO_ASSERT on pool parameter

When the function mgcp_client_pool_vty_init is called with pool = NULL,
then it segfaults. Lets put an OSMO_ASSERT() on pool to make clear that
a pool must be present before initalizing the VTY on it.

Change-Id: I36893bf5341d4ad21161e92d2d25d284647f7d18
---
M src/libosmo-mgcp-client/mgcp_client_vty.c
1 file changed, 3 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c
index 7ad1485..7d41ee1 100644
--- a/src/libosmo-mgcp-client/mgcp_client_vty.c
+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c
@@ -517,6 +517,9 @@
  *  \param[in] pool user provided memory to store the configured MGCP client (MGW) pool. */
 void mgcp_client_pool_vty_init(int parent_node, int mgw_node, const char *indent, struct mgcp_client_pool *pool)
 {
+	/* A pool must be allocated before this function can be called */
+	OSMO_ASSERT(pool);
+
 	/* Never allow this function to be called twice on the same pool */
 	OSMO_ASSERT(!pool->vty_indent);
 	OSMO_ASSERT(!pool->vty_node);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/25208
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I36893bf5341d4ad21161e92d2d25d284647f7d18
Gerrit-Change-Number: 25208
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210819/d2d7bf89/attachment.htm>


More information about the gerrit-log mailing list