crach fix in GetOwnCert 73/27873/2
authorOleksandr Dmytrenko <o.dmytrenko@samsung.com>
Tue, 22 Jan 2019 13:26:04 +0000 (15:26 +0200)
committerAleksey Volkov <a.volkov@samsung.com>
Thu, 24 Jan 2019 09:17:29 +0000 (09:17 +0000)
crach fix in GetOwnCert, in debug mode in case null chain

Change-Id: I2c394a1953b8b20015c53607325b5181750bf564
Signed-off-by: Oleksandr Dmytrenko <o.dmytrenko@samsung.com>
resource/csdk/security/src/credresource.c

index 8cadda2..c6b57b2 100644 (file)
@@ -3847,7 +3847,7 @@ void GetOwnCert(ByteArrayLL_t * chain, const char * usage)
         OIC_LOG_V(WARNING, TAG, "%s not found", usage);
     }
 #ifndef NDEBUG
-    if(0 < chain->cert->len)
+    else if(0 < chain->cert->len)
     {
         OIC_LOG(DEBUG, TAG_LOG, "==== Cert being returned ===================================");
         LogCert ( chain->cert->data, chain->cert->len, OIC_ENCODING_PEM, TAG_LOG );