Fix Coverity issue 18/253718/1 accepted/tizen/unified/20210219.040834 submit/tizen/20210218.214305
authorJihoon Jung <jh8801.jung@samsung.com>
Wed, 17 Feb 2021 01:34:58 +0000 (10:34 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Wed, 17 Feb 2021 01:49:43 +0000 (10:49 +0900)
- [CID : 1218278] Dereference null return value

Change-Id: Id8dd9d5fef58a9bccb6dc9347252bf3cf06a0dc0
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
common/OpensslHelper.cpp

index c34d657..78ad789 100644 (file)
@@ -149,6 +149,10 @@ namespace smartcard_service_api
 #else // OpenSSL 1.1.1
                        EVP_MD_CTX *mdCtx;
                        mdCtx = EVP_MD_CTX_new();
+                       if (mdCtx == NULL) {
+                               _ERR("mdCtx is NULL");
+                               return false;
+                       }
 #endif
                        unsigned int resultLen = 0;