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

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