Fix possible uninit accesses 29/24229/6
authorMats Wichmann <mats@linux.com>
Wed, 15 Nov 2017 17:17:45 +0000 (10:17 -0700)
committerMats Wichmann <mats@linux.com>
Wed, 29 Aug 2018 16:15:23 +0000 (16:15 +0000)
Change-Id: Ib3cbbae66326f40ade6ff4e0e7960e8698c4c37c
Signed-off-by: Mats Wichmann <mats@linux.com>
resource/csdk/resource-directory/unittests/rddatabase.cpp

index 05677b6..f77ac80 100644 (file)
@@ -106,7 +106,7 @@ static OCRepPayload *CreateRDPublishPayload(const char *deviceId,
     EXPECT_TRUE(OCRepPayloadSetPropString(repPayload, OC_RSRVD_DEVICE_ID, deviceId));
     EXPECT_TRUE(OCRepPayloadSetPropInt(repPayload, OC_RSRVD_DEVICE_TTL, (ttl == 0 ? 86400: ttl)));
 
-    const OCRepPayload *linkArr[nresources];
+    const OCRepPayload *linkArr[nresources] = {0};
     size_t dimensions[MAX_REP_ARRAY_DEPTH] = {nresources, 0, 0};
 
     for (size_t i = 0; i < nresources; ++i)