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
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index fb99911..86edf00 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -765,6 +765,7 @@
struct mgcp_config *cfg;
int i;
char last_conn_id[256];
+ int rc;
cfg = mgcp_config_alloc();
@@ -792,9 +793,11 @@
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);