mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-mgw.git
synced 2025-10-23 08:12:01 +00:00
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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user