From: Jérémie Galarneau Date: Tue, 9 Mar 2021 21:23:37 +0000 (-0500) Subject: msgpack: silence uninitialized msg_pack_object warning X-Git-Tag: v2.13.0-rc1~253 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=c1710c3bcf2e90d6f4cad986ee8d31f9b3c10f5d msgpack: silence uninitialized msg_pack_object warning Present in the upstream msgpack code. I couldn't find a problematic use, but this will silence Coverity and is cleaner. Nothing should access 'via' when the type of a msg_pack_object is NIL. Coverity report: 1448708 Uninitialized scalar variable The variable will contain an arbitrary value left from earlier computations. In template_callback_root: Use of an uninitialized variable (CWE-457) Reported-by: Coverity Scan Signed-off-by: Jérémie Galarneau Change-Id: I4fe63b0279ca7c3f4c34ee8762ec724a731894c5 --- diff --git a/src/vendor/msgpack/unpack.c b/src/vendor/msgpack/unpack.c index b390f5868..6b10f05b1 100644 --- a/src/vendor/msgpack/unpack.c +++ b/src/vendor/msgpack/unpack.c @@ -50,7 +50,7 @@ static int template_execute( static inline msgpack_object template_callback_root(unpack_user* u) { - msgpack_object o; + msgpack_object o = {}; MSGPACK_UNUSED(u); o.type = MSGPACK_OBJECT_NIL; return o;