[PATCH] osmo-mgw[master]: client: prohibit endpoint ids without @ character

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
Wed Jan 31 16:42:31 UTC 2018


Review at  https://gerrit.osmocom.org/6221

client: prohibit endpoint ids without @ character

The function mgcp_msg_gen() does only check if the user supplied
an endpoint name or not. The user may still supply an endpoint
name that does not contain the separator (@) character.

- Refuse to generate the message if the endpoint name does not
  contain any @ character.

Change-Id: I92dd1556e4a26b4bef8e1c8c57141552abf988ca
---
M src/libosmo-mgcp-client/mgcp_client.c
1 file changed, 8 insertions(+), 0 deletions(-)


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

diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 593d305..efe1d1f 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -862,6 +862,14 @@
 			msgb_free(msg);
 			return NULL;
 		}
+
+		if (strstr(mgcp_msg->endpoint, "@") == NULL) {
+			LOGP(DLMGCP, LOGL_ERROR,
+			     "Endpoint name (%s) lacks separator (@), can not generate MGCP message\n",
+			     mgcp_msg->endpoint);
+			msgb_free(msg);
+		}
+
 		rc += msgb_printf(msg, " %s", mgcp_msg->endpoint);
 	}
 

-- 
To view, visit https://gerrit.osmocom.org/6221
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92dd1556e4a26b4bef8e1c8c57141552abf988ca
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>



More information about the gerrit-log mailing list