From 52cb8c0f651ade8d057a264eea1de534ead36517 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 14 Jun 2022 12:04:07 -0400 Subject: [PATCH] Clean-up: common: uuid: uninitialized output parameter on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 1490018 Uninitialized scalar variable The variable will contain an arbitrary value left from earlier computations. In lttng_uuid_from_str(char const *, std::​array &): Use of an uninitialized variable (CWE-457) Callers should not use the return parameter anyhow on error. Signed-off-by: Jérémie Galarneau Change-Id: Idd863d219da840a0c291478733f7b931967a5e56 --- src/common/uuid.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp index d4f0fb2bf..dd59edc31 100644 --- a/src/common/uuid.cpp +++ b/src/common/uuid.cpp @@ -57,6 +57,7 @@ int lttng_uuid_from_str(const char *str_in, lttng_uuid& uuid_out) if (sscanf(str_in, LTTNG_UUID_FMT, LTTNG_UUID_SCAN_VALUES(uuid_scan)) != LTTNG_UUID_LEN) { ret = -1; + goto end; } uuid_out = uuid_scan; -- 2.34.1