Fix uninitialized value (valgrind) 05/24605/2
authorGeorge Nash <george.nash@intel.com>
Fri, 6 Apr 2018 21:38:47 +0000 (14:38 -0700)
committerMats Wichmann <mats@linux.com>
Tue, 24 Apr 2018 23:40:32 +0000 (23:40 +0000)
Valgrind reported that the buffer was not initilized
before being used for a conditional jump. This change
zero ('/0') intilizes the buffer.

Change-Id: I51d1716167f3da628783bef6bd733ab06e24de1e
Signed-off-by: George Nash <george.nash@intel.com>
resource/csdk/connectivity/test/cacertprofiletest.cpp

index 90f45e9..227b004 100644 (file)
@@ -739,8 +739,8 @@ static CertProfileResult GenerateTestCert(CertType certType, CertProfileViolatio
     int mbedRet = 0;
     CertProfileResult cpResult = CP_STATUS_OK;
 
-    char buf[2048];
-    char mbedErrBuf[256];
+    char buf[2048] = "";
+    char mbedErrBuf[256] = "";
 
     int isCa = 0;
     int maxPathLen = 0;