[IOT-2539] Remove maybe-uninitialized warning
authorGeorge Nash <george.nash@intel.com>
Tue, 1 Aug 2017 18:21:09 +0000 (11:21 -0700)
committerMats Wichmann <mats@linux.com>
Wed, 27 Sep 2017 14:39:37 +0000 (14:39 +0000)
The compiler was indicating that the request.len and
request.bytes maybe used uninitialized. Best I can
tell the OCByteString is initilaized in the GenerateCSR
function. The compiler can not tell that it is
initilaized so it is zero initialized at creation.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I19dd9818b1485ec0da64b48dc2510c8e939c6c0f
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21703
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 88ce2816c8cca2f775927a03b2843446cc743e6d)

resource/csdk/security/provisioning/src/cloud/csr.c

index 5df4655abbd429ee207739b48762171ecf652737..9c4796d3d83083a7ac5561a287819cc25f3308ce 100644 (file)
@@ -397,7 +397,7 @@ OCStackResult OCCloudCertificateIssueRequest(void* ctx,
 
     OIC_LOG_V(DEBUG, TAG, "Certificate Request subject: %s", subject);
 
-    OCByteString request;
+    OCByteString request = { 0 };
     if (0 != GenerateCSR(subject, &request))
     {
         OIC_LOG(ERROR, TAG, "Cann't get the sertificate request");