krb5 commit: Fix minor errors in softpkcs11

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/560e48fee9a192ed4eb1b6cbd62c119087b53948
commit 560e48fee9a192ed4eb1b6cbd62c119087b53948
Author: Robbie Harwood <[email protected]>
Date:   Fri Nov 8 14:28:56 2019 -0500

    Fix minor errors in softpkcs11
    
    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.
    
    [[email protected]: squashed commits and rewrote commit message]

 src/tests/softpkcs11/main.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/tests/softpkcs11/main.c b/src/tests/softpkcs11/main.c
index a4c3ae7..1cccdfb 100644
--- a/src/tests/softpkcs11/main.c
+++ b/src/tests/softpkcs11/main.c
@@ -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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.