Skip to content

Commit

Permalink
Fix minor errors in softpkcs11
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
frozencemetery authored and greghudson committed Nov 13, 2019
1 parent 5f497a6 commit 560e48f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tests/softpkcs11/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 560e48f

Please sign in to comment.