mgcp_test: fix wrong strcmp() parameters

The CRCX string parameter lacks the quotes and the result of
the function call is not checked against zero. Also the
return code of get_conn_id_from_response() is not asserted.

Fixes: Coverity CID#180534

Change-Id: If4f3ed2c3572da196160569a9705b7a302b700a9
This commit is contained in:
Philipp Maier
2017-12-04 16:48:45 +01:00
parent 1c3287f1db
commit 23b8e29835

View File

@@ -765,6 +765,7 @@ static void test_retransmission(void)
struct mgcp_config *cfg;
int i;
char last_conn_id[256];
int rc;
cfg = mgcp_config_alloc();
@@ -792,9 +793,11 @@ static void test_retransmission(void)
OSMO_ASSERT(false);
}
if (msg && strcmp(t->name, CRCX))
get_conn_id_from_response(msg->data, last_conn_id,
sizeof(last_conn_id));
if (msg && strcmp(t->name, "CRCX") == 0) {
rc = get_conn_id_from_response(msg->data, last_conn_id,
sizeof(last_conn_id));
OSMO_ASSERT(rc == 0);
}
msgb_free(msg);