From c1710c3bcf2e90d6f4cad986ee8d31f9b3c10f5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 9 Mar 2021 16:23:37 -0500 Subject: [PATCH] msgpack: silence uninitialized msg_pack_object warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/vendor/msgpack/unpack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.34.1