X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Furi.c;h=0f89468c54f3c0f10aa1610df592a6d430a4bd27;hp=0638aebd90026ea9b7378106927ec5d9796af704;hb=05932fe8da075311149e8b2608a70fc0e3be3187;hpb=97abbc84fe032ca8d7cce7b8e64200981ffa6966 diff --git a/src/common/uri.c b/src/common/uri.c index 0638aebd9..0f89468c5 100644 --- a/src/common/uri.c +++ b/src/common/uri.c @@ -577,6 +577,9 @@ ssize_t uri_parse_str_urls(const char *ctrl_url, const char *data_url, goto parse_error; } + /* 1 and 2 are the only expected values on success. */ + assert(size_ctrl == 1 || size_ctrl == 2); + /* At this point, we know there is at least one URI in the array */ set_default_uri_attr(&ctrl_uris[0], LTTNG_STREAM_CONTROL); @@ -614,6 +617,9 @@ ssize_t uri_parse_str_urls(const char *ctrl_url, const char *data_url, } else if (size_data == 2) { ERR("Data URL can not be set with the net[4|6]:// protocol"); goto error; + } else { + /* 1 and 2 are the only expected values on success. */ + assert(size_data == 1); } set_default_uri_attr(&data_uris[0], LTTNG_STREAM_DATA);