From 903055eacdbfa126826011ecd0845127585244da Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 4 Feb 2014 14:52:49 -0500 Subject: [PATCH] Fix: handle invalid URL passed to lttng_create_session_live MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit uri_parse_str_urls() returns 0 if the URL passed is NULL thus using lttng_create_session_live() without an URL is invalid. Reported-by: Jérémie Galarneau Signed-off-by: David Goulet --- src/lib/lttng-ctl/lttng-ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 3f6635e8f..7d06c7a0c 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1558,7 +1558,7 @@ int lttng_create_session_live(const char *name, const char *url, lttng_ctl_copy_string(lsm.session.name, name, sizeof(lsm.session.name)); size = uri_parse_str_urls(url, NULL, &uris); - if (size < 0) { + if (size <= 0) { ret = -LTTNG_ERR_INVALID; goto end; } -- 2.34.1