]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix minor errors in softpkcs11 997/head
authorRobbie Harwood <rharwood@redhat.com>
Fri, 8 Nov 2019 19:28:56 +0000 (14:28 -0500)
committerGreg Hudson <ghudson@mit.edu>
Wed, 13 Nov 2019 21:02:09 +0000 (16:02 -0500)
Fix a printf type mismatch in attributes_match() reported by Coverity,
and a possible uninitizlied use of key_type in add_certificate()
reported by clang.

[ghudson@mit.edu: squashed commits and rewrote commit message]

src/tests/softpkcs11/main.c

index a4c3ae78efe3f196096b505b923fdbde8b3f26b7..1cccdfb43193e343bd11ccfa3d5ec870c7ba380b 100644 (file)
@@ -261,7 +261,7 @@ attributes_match(const struct st_object *obj,
             }
         }
         if (match == 0) {
-            st_logf("type %d attribute have no match\n", attributes[i].type);
+            st_logf("type %lu attribute have no match\n", attributes[i].type);
             return 0;
         }
     }
@@ -553,8 +553,9 @@ add_certificate(char *label,
         key_type = CKK_DSA;
         break;
     default:
-        /* XXX */
-        break;
+        st_logf("invalid key_type\n");
+        ret = CKR_GENERAL_ERROR;
+        goto out;
     }
 
     c = CKO_CERTIFICATE;