From: David Goulet Date: Tue, 4 Feb 2014 19:52:49 +0000 (-0500) Subject: Fix: handle invalid URL passed to lttng_create_session_live X-Git-Tag: v2.4.0-rc5~54 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1c488f632753020069018ed4d430673ef0a87fc2;p=lttng-tools.git Fix: handle invalid URL passed to lttng_create_session_live 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 --- 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; }