Skip to content

Commit

Permalink
Fix dereference before NULL check
Browse files Browse the repository at this point in the history
Coverity CID 379852
  • Loading branch information
mtrojnar committed Mar 14, 2024
1 parent dcd7ea2 commit 1ab75f0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/p11_ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,13 @@ static int pkcs11_get_point(EC_KEY *ec, PKCS11_OBJECT_private *key, CK_SESSION_H
ASN1_OCTET_STRING *os;
int rv = -1;

if (!key)
return -1;

if (key->x509 && pkcs11_get_point_x509(ec, key->x509) == 0)
return 0;

if (!key || pkcs11_getattr_alloc(key->slot->ctx, session, key->object,
if (pkcs11_getattr_alloc(key->slot->ctx, session, key->object,
CKA_EC_POINT, &point, &point_len))
return -1;

Expand Down

0 comments on commit 1ab75f0

Please sign in to comment.