From: Jonathan Rajotte Date: Tue, 4 Feb 2020 21:03:40 +0000 (-0500) Subject: Fix: string might be uninitialized X-Git-Tag: v2.12.0-rc2~73 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=af5f74ff58c7d766e2b1a0a5993cbd5b8a730d3d;p=lttng-tools.git Fix: string might be uninitialized lttng_dynamic_appen_buffer accepts NULL buf as long as len is zero when called. This is the case for when the id is a numeric value. Signed-off-by: Jonathan Rajotte Change-Id: Ia1a121dcc2448378a4ad873ac159a89221e4c637 Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/tracker.c b/src/common/tracker.c index 0fdbd60f9..7c97d561c 100644 --- a/src/common/tracker.c +++ b/src/common/tracker.c @@ -302,7 +302,7 @@ int lttng_tracker_ids_serialize(const struct lttng_tracker_ids *ids, { int ret = 0; int value; - const char *string; + const char *string = NULL; unsigned int count; enum lttng_tracker_id_status status; const struct lttng_tracker_id *id;