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
This commit is contained in:
Neels Hofmeyr
2018-08-28 16:19:25 +02:00
committed by Neels Hofmeyr
parent 08e07046f9
commit b861db97ea

View File

@@ -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 @@ static int get_conn_id_from_response(uint8_t *resp, char *conn_id,
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