From: Jérémie Galarneau Date: Tue, 14 Jun 2022 16:04:07 +0000 (-0400) Subject: Clean-up: common: uuid: uninitialized output parameter on error X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=52cb8c0f651ade8d057a264eea1de534ead36517;p=lttng-tools.git Clean-up: common: uuid: uninitialized output parameter on error 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 --- 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;