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