Change in osmo-mgw[master]: mgcp_test: fix get_conn_id_from_response() CI length

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Aug 30 14:23:13 UTC 2018


Neels Hofmeyr has submitted this change and it was merged. ( https://gerrit.osmocom.org/10675 )

Change subject: mgcp_test: fix get_conn_id_from_response() CI length
......................................................................

mgcp_test: fix get_conn_id_from_response() CI length

This function is set on conn ID length of 32 characters. Make it detect a
shorter length also when parsing 'o=-' headers. Before, this failed to
recognize a space as the end of the conn ID, now sees any non-hex char as end.

Related: OS#3507
Change-Id: I762c273bac172acb6d0aae6ea6267603ab654cbf
---
M tests/mgcp/mgcp_test.c
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 228b2f9..2f3a8a7 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -37,6 +37,7 @@
 #include <dlfcn.h>
 #include <time.h>
 #include <math.h>
+#include <ctype.h>
 
 char *strline_r(char *str, char **saveptr);
 
@@ -626,8 +627,10 @@
 
 	if (got_conn_id) {
 		for (i = 0; i < conn_id_len; i++) {
-			if (conn_id[i] == '\n' || conn_id[i] == '\r')
+			if (!isxdigit(conn_id[i])) {
 				conn_id[i] = '\0';
+				break;
+			}
 		}
 
 		/* A valid conn_id must at least contain one digit, and must

-- 
To view, visit https://gerrit.osmocom.org/10675
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I762c273bac172acb6d0aae6ea6267603ab654cbf
Gerrit-Change-Number: 10675
Gerrit-PatchSet: 2
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180830/55536591/attachment.htm>


More information about the gerrit-log mailing list