Fixed Dereference before null check
As reported by coverity scan
This commit is contained in:
parent
0fd77d642c
commit
72836fa3cb
|
@ -505,7 +505,7 @@ static int idprime_select_file(sc_card_t *card, const sc_path_t *in_path, sc_fil
|
|||
priv->cached = 0;
|
||||
|
||||
r = iso_ops->select_file(card, in_path, file_out);
|
||||
if (r == SC_SUCCESS && priv && file_out != NULL) {
|
||||
if (r == SC_SUCCESS && file_out != NULL) {
|
||||
/* Try to read first bytes of the file to fix FCI in case of
|
||||
* compressed certififcate */
|
||||
len = iso_ops->read_binary(card, 0, data, data_len, 0);
|
||||
|
|
|
@ -1871,7 +1871,7 @@ sc_pkcs15init_store_public_key(struct sc_pkcs15_card *p15card, struct sc_profile
|
|||
profile->dirty = 1;
|
||||
|
||||
err:
|
||||
if (object && r < 0)
|
||||
if (r < 0)
|
||||
sc_pkcs15init_free_object(object);
|
||||
|
||||
LOG_FUNC_RETURN(ctx, r);
|
||||
|
|
|
@ -132,8 +132,12 @@ static char * get_pin(struct sc_pkcs15_object *obj)
|
|||
{
|
||||
char buf[(sizeof obj->label) + 20];
|
||||
char *pincode;
|
||||
struct sc_pkcs15_auth_info *pinfo = (struct sc_pkcs15_auth_info *) obj->data;
|
||||
struct sc_pkcs15_auth_info *pinfo;
|
||||
|
||||
if (!obj)
|
||||
return NULL;
|
||||
|
||||
pinfo = (struct sc_pkcs15_auth_info *) obj->data;
|
||||
if (pinfo->auth_type != SC_PKCS15_PIN_AUTH_TYPE_PIN)
|
||||
return NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue