[p15dump] Do not attempt to access NULL pointer

This commit is contained in:
Jakub Jelen 2016-05-17 14:15:16 +02:00 committed by Viktor Tarasov
parent 462bebd380
commit e309d0f06f

View File

@ -66,10 +66,11 @@ static int dump_unusedspace(void)
if (p15card->file_unusedspace != NULL)
path = p15card->file_unusedspace->path;
else {
else if (p15card->file_app != NULL) {
path = p15card->file_app->path;
sc_append_path_id(&path, (const u8 *) "\x50\x33", 2);
}
} else
return -1;
path.count = -1;
r = sc_pkcs15_read_file(p15card, &path, &buf, &buf_len);