fixed Dereference before null check

This commit is contained in:
Frank Morgner 2018-08-23 09:59:45 +02:00
parent 67fbf15741
commit 70c4813f30
1 changed files with 2 additions and 1 deletions

View File

@ -1212,7 +1212,7 @@ static int mcrd_restore_se(sc_card_t * card, int se_num)
static int mcrd_set_security_env(sc_card_t * card,
const sc_security_env_t * env, int se_num)
{
struct mcrd_priv_data *priv = DRVDATA(card);
struct mcrd_priv_data *priv;
sc_apdu_t apdu;
sc_path_t tmppath;
u8 sbuf[SC_MAX_APDU_BUFFER_SIZE];
@ -1222,6 +1222,7 @@ static int mcrd_set_security_env(sc_card_t * card,
if (!(card != NULL && env != NULL))
return SC_ERROR_INTERNAL;
SC_FUNC_CALLED(card->ctx, SC_LOG_DEBUG_NORMAL);
priv = DRVDATA(card);
/* special environment handling for esteid, stolen from openpgp */
if (is_esteid_card(card)) {