added error checking

This commit is contained in:
Frank Morgner 2015-10-14 22:28:49 +02:00
parent 00daa3f535
commit 895005f4df
1 changed files with 1 additions and 1 deletions

View File

@ -225,7 +225,7 @@ int dnie_read_file(sc_card_t * card,
LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_ARGUMENTS);
/* select file by mean of iso7816 ops */
res = card->ops->select_file(card, path, file);
if (res != SC_SUCCESS) {
if (res != SC_SUCCESS || !file || !(*file)) {
msg = "select_file failed";
goto dnie_read_file_err;
}