OpenPGP: improve get_full_pgp_aid()'s parameter checking
This commit is contained in:
parent
2a7a6a62fa
commit
2e1b47a79a
|
@ -364,10 +364,13 @@ struct pgp_priv_data {
|
|||
static int
|
||||
get_full_pgp_aid(sc_card_t *card, sc_file_t *file)
|
||||
{
|
||||
int r = 0;
|
||||
/* explicitly get the full aid */
|
||||
r = sc_get_data(card, 0x004F, file->name, sizeof file->name);
|
||||
file->namelen = MAX(r, 0);
|
||||
int r = SC_ERROR_INVALID_ARGUMENTS;
|
||||
|
||||
if (file != NULL) {
|
||||
/* explicitly get the full aid */
|
||||
r = sc_get_data(card, 0x004F, file->name, sizeof file->name);
|
||||
file->namelen = MAX(r, 0);
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue