Blame SOURCES/nss-3.44-kbkdf-coverity.patch

ddf7d0
diff -up ./lib/softoken/kbkdf.c.coverity ./lib/softoken/kbkdf.c
ddf7d0
--- ./lib/softoken/kbkdf.c.coverity	2019-12-03 15:33:43.047732312 -0800
ddf7d0
+++ ./lib/softoken/kbkdf.c	2019-12-03 15:39:40.982578357 -0800
ddf7d0
@@ -534,6 +534,10 @@ CK_RV kbkdf_CreateKey(CK_SESSION_HANDLE
ddf7d0
     PR_ASSERT(derived_key != NULL);
ddf7d0
     PR_ASSERT(derived_key->phKey != NULL);
ddf7d0
 
ddf7d0
+    if (slot == NULL) {
ddf7d0
+        return CKR_SESSION_HANDLE_INVALID;
ddf7d0
+    }
ddf7d0
+
ddf7d0
     /* Create the new key object for this additional derived key. */
ddf7d0
     key = sftk_NewObject(slot);
ddf7d0
     if (key == NULL) {
ddf7d0
@@ -589,7 +593,9 @@ done:
ddf7d0
     sftk_FreeObject(key);
ddf7d0
 
ddf7d0
     /* Doesn't do anything. */
ddf7d0
-    sftk_FreeSession(session);
ddf7d0
+    if (session) {
ddf7d0
+        sftk_FreeSession(session);
ddf7d0
+    }
ddf7d0
 
ddf7d0
     return ret;
ddf7d0
 }
ddf7d0
diff -up ./lib/softoken/sftkhmac.c.coverity ./lib/softoken/sftkhmac.c
ddf7d0
--- ./lib/softoken/sftkhmac.c.coverity	2019-12-03 15:40:06.108848341 -0800
ddf7d0
+++ ./lib/softoken/sftkhmac.c	2019-12-03 15:41:04.919480267 -0800
ddf7d0
@@ -232,7 +232,9 @@ sftk_MAC_Init(sftk_MACCtx *ctx, CK_MECHA
ddf7d0
                            keyval->attrib.ulValueLen, isFIPS);
ddf7d0
 
ddf7d0
 done:
ddf7d0
-    sftk_FreeAttribute(keyval);
ddf7d0
+    if (keyval) {
ddf7d0
+        sftk_FreeAttribute(keyval);
ddf7d0
+    }
ddf7d0
     return ret;
ddf7d0
 }
ddf7d0