Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coverity Fixes 4 #57

Merged
merged 3 commits into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ P11PROV_KEY *p11prov_create_secret_key(P11PROV_CTX *provctx,

sess = p11prov_session_handle(session);

P11PROV_debug("keys: create secret key (session:%ul secret:%p[%zu])", sess,
P11PROV_debug("keys: create secret key (session:%lu secret:%p[%zu])", sess,
secret, secretlen);

ret = p11prov_ctx_status(provctx, &f);
Expand Down
8 changes: 4 additions & 4 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static CK_RV internal_session_open(P11PROV_SESSION_POOL *p, CK_SLOT_ID slot,

wait_ok = false;
ret = f->C_OpenSession(slot, CKF_SERIAL_SESSION, NULL, NULL, session);
P11PROV_debug("C_OpenSession ret:%lu (session: %lu)", ret, session);
P11PROV_debug("C_OpenSession ret:%lu (session: %lu)", ret, *session);
if (ret == CKR_SESSION_COUNT) {
wait_ok = cyclewait_with_timeout(MAX_WAIT, SLEEP, &startime);
}
Expand Down Expand Up @@ -492,10 +492,10 @@ CK_RV p11prov_get_session(P11PROV_CTX *provctx, CK_SLOT_ID *slotid,
pthread_mutex_lock(&slot->pool->lock);
for (i = 0; i < slot->pool->num_p11sessions; i++) {
if (slot->pool->sessions[i]->free) {
/* store the first free session we find, but continue to search for
* a free session with an actual cached token session */
if (slot->pool->sessions[i]->session == CK_INVALID_HANDLE) {
/* store session found but continue to search for one with
* an actual cached token session if any is available */
if (session != NULL) {
if (session == NULL) {
session = slot->pool->sessions[i];
}
continue;
Expand Down