From: Jérémie Galarneau Date: Wed, 11 Sep 2019 17:16:48 +0000 (-0400) Subject: sessiond: fix: print_escaped_ctf_string mishandles empty string X-Git-Tag: v2.11.0-rc4~53 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0272046cf2fb096d3c75aa1fa1e32b9aeb1169ce;p=lttng-tools.git sessiond: fix: print_escaped_ctf_string mishandles empty string The return value of print_escaped_ctf_string() is uninitialized in the case of an empty string (""). Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/ust-metadata.c b/src/bin/lttng-sessiond/ust-metadata.c index 7c6cbc63d..0eccac654 100644 --- a/src/bin/lttng-sessiond/ust-metadata.c +++ b/src/bin/lttng-sessiond/ust-metadata.c @@ -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;