From ee91c8179900f4b74cdba1ecad9fc318c6a8e945 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Tue, 19 May 2020 17:40:51 -0700 Subject: [PATCH] Initialize C arrays to NULL in NetworkConfig() constructor --- node/NetworkConfig.cpp | 8 ++++---- node/NetworkConfig.hpp | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/node/NetworkConfig.cpp b/node/NetworkConfig.cpp index e45a111d2..97985c7af 100644 --- a/node/NetworkConfig.cpp +++ b/node/NetworkConfig.cpp @@ -22,7 +22,7 @@ namespace ZeroTier { bool NetworkConfig::toDictionary(Dictionary &d,bool includeLegacy) const { Buffer *tmp = new Buffer(); - char tmp2[128]; + char tmp2[128] = {0}; try { d.clear(); @@ -84,7 +84,7 @@ bool NetworkConfig::toDictionary(Dictionary &d,b if (((int)lastrt < 32)||(lastrt == ZT_NETWORK_RULE_MATCH_ETHERTYPE)) { if (ets.length() > 0) ets.push_back(','); - char tmp2[16]; + char tmp2[16] = {0}; ets.append(Utils::hex((uint16_t)et,tmp2)); } et = 0; @@ -104,7 +104,7 @@ bool NetworkConfig::toDictionary(Dictionary &d,b if ((this->specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_ACTIVE_BRIDGE) != 0) { if (ab.length() > 0) ab.push_back(','); - char tmp2[16]; + char tmp2[16] = {0}; ab.append(Address(this->specialists[i]).toString(tmp2)); } } @@ -220,7 +220,7 @@ bool NetworkConfig::fromDictionary(const Dictionary