From: Robbie Harwood Date: Fri, 8 Nov 2019 19:28:56 +0000 (-0500) Subject: Fix minor errors in softpkcs11 X-Git-Tag: krb5-1.18-beta1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F997%2Fhead;p=thirdparty%2Fkrb5.git 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. [ghudson@mit.edu: squashed commits and rewrote commit message] --- diff --git a/src/tests/softpkcs11/main.c b/src/tests/softpkcs11/main.c index a4c3ae78ef..1cccdfb431 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;