From b25efbb9962877f0d396c064e41eac1810fa32a3 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Fri, 28 Mar 2014 21:40:43 +0400 Subject: [PATCH] Fixed uninitialized variable in Array<> --- libuavcan/include/uavcan/marshal/array.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libuavcan/include/uavcan/marshal/array.hpp b/libuavcan/include/uavcan/marshal/array.hpp index 49c5e78b21..d563a012b9 100644 --- a/libuavcan/include/uavcan/marshal/array.hpp +++ b/libuavcan/include/uavcan/marshal/array.hpp @@ -277,7 +277,7 @@ class Array : public ArrayImpl for (SizeType i = 0; i < size(); i++) { const bool last_item = i == (size() - 1); - ValueType value; // TODO: avoid extra copy + ValueType value = ValueType(); // TODO: avoid extra copy const int res = RawValueType::decode(value, codec, last_item ? tao_mode : TailArrayOptDisabled); if (res <= 0) { @@ -296,7 +296,7 @@ class Array : public ArrayImpl { while (true) { - ValueType value; + ValueType value = ValueType(); const int res = RawValueType::decode(value, codec, TailArrayOptDisabled); if (res < 0) {