Skip to content

Commit 1868d02

Browse files
committed
Cast precision argument to int in debug log
The `%.*s` format specifier expects an int for the precision argument, but `label.ulValueLen` is a CK_ULONG. Cast the length to int to prevent type mismatch. Fixes CID 643611 from Coverity. Signed-off-by: Simo Sorce <simo@redhat.com>
1 parent acf46db commit 1868d02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/obj/fetch.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,8 @@ CK_RV p11prov_obj_find(P11PROV_CTX *provctx, P11PROV_SESSION *session,
488488
CK_RV ret;
489489

490490
P11PROV_debug("Find objects [class=%lu, id-len=%lu, label=%.*s]", class,
491-
id.ulValueLen, label.type == CKA_LABEL ? label.ulValueLen : 4,
491+
id.ulValueLen,
492+
label.type == CKA_LABEL ? (int)label.ulValueLen : 4,
492493
label.type == CKA_LABEL ? (char *)label.pValue : "None");
493494

494495
switch (class) {

0 commit comments

Comments
 (0)