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.12.0-rc1~400 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=35c829f8c54cc79fabc38151de90ce75d626e7c5;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;