Skip to content

Commit

Permalink
Fix incorrect error handling
Browse files Browse the repository at this point in the history
Originally discovered by Coverity as an unused value and a NULL
dereference, it was actually an unfinished error condition check.

Fixes CID 469486: Code maintainability issues (UNUSED_VALUE)
Fixes CID 469485: Null pointer dereferences (FORWARD_NULL)

Signed-off-by: Simo Sorce <[email protected]>
  • Loading branch information
simo5 committed Nov 30, 2023
1 parent 9ee62b7 commit 4cade28
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,11 +559,13 @@ CK_RV p11prov_context_specific_login(P11PROV_SESSION *session, P11PROV_URI *uri,
slot = p11prov_get_slot_by_id(sctx, p11prov_session_slotid(session));
if (!slot) {
ret = CKR_GENERAL_ERROR;
goto done;
}

ret =
token_login(session, uri, pw_cb, pw_cbarg, slot, CKU_CONTEXT_SPECIFIC);

done:
p11prov_return_slots(sctx);
return ret;
}
Expand Down

0 comments on commit 4cade28

Please sign in to comment.