Fix maybe-uninitialized warning in ca_adapter_net_ssl.c
authorGeorge Nash <george.nash@intel.com>
Thu, 26 Jan 2017 19:00:13 +0000 (11:00 -0800)
committerMike Fenelon <mike.fenelon@microsoft.com>
Mon, 30 Jan 2017 18:24:39 +0000 (18:24 +0000)
The compilar was warning that the variables macKeyLen, ivSize, and keySize
could be used uninitialized. Very unlikely but really easy to fix.

Change-Id: Ie3a8872194c3ffe3a43576cdc399f8a1e99e3387
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/16799
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Kevin Kane <kkane@microsoft.com>
Reviewed-by: Mike Fenelon <mike.fenelon@microsoft.com>
resource/csdk/connectivity/src/adapter_util/ca_adapter_net_ssl.c

index 938d961..de28bfb 100644 (file)
@@ -2218,9 +2218,9 @@ CAResult_t CAsslGenerateOwnerPsk(const CAEndpoint_t *endpoint,
     }
 
     // keyBlockLen set up according to OIC 1.1 Security Specification Section 7.3.2
-    int macKeyLen;
-    int ivSize;
-    int keySize;
+    int macKeyLen = 0;
+    int ivSize = 0;
+    int keySize = 0;
     int keyBlockLen = 0;
     if (MBEDTLS_TLS_ECDH_ANON_WITH_AES_128_CBC_SHA256 == g_caSslContext->selectedCipher ||
         MBEDTLS_TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 == g_caSslContext->selectedCipher ||