Fix: handle invalid URL passed to lttng_create_session_live
authorDavid Goulet <dgoulet@efficios.com>
Tue, 4 Feb 2014 19:52:49 +0000 (14:52 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 4 Feb 2014 19:52:49 +0000 (14:52 -0500)
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 <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/lib/lttng-ctl/lttng-ctl.c

index 3f6635e8f759c751d11f3d5402452ca9f7d37aeb..7d06c7a0cb41b8f3396e4460c92c25afbc501d8b 100644 (file)
@@ -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;
        }
This page took 0.027607 seconds and 5 git commands to generate.