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

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Thu Aug 19 12:26:07 UTC 2021


dexter has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/08/25208/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210819/68e7ed2e/attachment.htm>


More information about the gerrit-log mailing list