[MERGED] osmo-mgw[master]: client: Do not accept endpoint ids with wildcards in responses

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Jan 31 23:37:52 UTC 2018


Harald Welte has submitted this change and it was merged.

Change subject: client: Do not accept endpoint ids with wildcards in responses
......................................................................


client: Do not accept endpoint ids with wildcards in responses

When the client gets a specific endpoint identifier (Z) in a
MGCP response it just accepts the identifier even when it is
not specific (contsins wildcard characters). In those cases,
the client should refuse to parse the response.

- Check for wildcards in endpoint identifiers and stop
  parsing when check is positive.

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

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index 771de45..d868c7f 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -356,6 +356,13 @@
 						   'Z', line);
 			if (rc)
 				goto exit;
+
+			/* A specific endpoint identifier returned by the MGW
+			 * must not contain any wildcard characters */
+			if (strstr(r->head.endpoint, "*") != NULL) {
+				rc = -EINVAL;
+				goto exit;
+			}
 			break;
 		case 'I':
 			rc = mgcp_parse_head_param(r->head.conn_id,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic94bd8c025b7b3eb006b639fecfd7282194e504a
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list