mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
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:
committed by
Neels Hofmeyr
parent
08e07046f9
commit
b861db97ea
@@ -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
|
||||
|
Reference in New Issue
Block a user