mgcp_client: error on too long conn id

Instead of just silently truncating the conn ID if it is too long, rather
verify its length and return an error where applicable.

Adjust expected test output.

Change-Id: If2a1aab1f13e771a6705c430e3c75bd42477a23b
diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c
index e9d7b3f..2a8cc15 100644
--- a/src/libosmo-mgcp-client/mgcp_client.c
+++ b/src/libosmo-mgcp-client/mgcp_client.c
@@ -550,6 +550,7 @@
 				 char label, const char *line)
 {
 	char label_string[4];
+	size_t rc;
 
 	/* Detect empty parameters */
 	if (strlen(line) < 4)
@@ -562,7 +563,14 @@
 
 	/* Copy payload part of the string to destinations (the label string
 	 * is always 3 chars long) */
-	osmo_strlcpy(result, line + 3, result_len);
+	rc = osmo_strlcpy(result, line + 3, result_len);
+	if (rc >= result_len) {
+		LOGP(DLMGCP, LOGL_ERROR,
+		     "Failed to parse MGCP response (parameter label: %c):"
+		     " the received conn ID is too long: %zu, maximum is %u characters\n",
+		     label, rc, result_len - 1);
+		return -ENOSPC;
+	}
 	return 0;
 
 response_parse_failure: