sessiond: fix: print_escaped_ctf_string mishandles empty string
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 11 Sep 2019 17:16:48 +0000 (13:16 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 11 Sep 2019 17:18:20 +0000 (13:18 -0400)
The return value of print_escaped_ctf_string() is uninitialized in the
case of an empty string ("").

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/ust-metadata.c

index 7c6cbc63d8370e29d7caf3ac7a2363c385c657b6..0eccac654883a6f4c0a1ea92604518b0aed13210 100644 (file)
@@ -220,7 +220,7 @@ void sanitize_ctf_identifier(char *out, const char *in)
 static
 int print_escaped_ctf_string(struct ust_registry_session *session, const char *string)
 {
-       int ret;
+       int ret = 0;
        size_t i;
        char cur;
 
This page took 0.034297 seconds and 4 git commands to generate.