pkcs15-pin.c: fixes segmentation fault in the case where p15card->app == NULL

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5104 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
andre 2011-01-17 21:09:48 +00:00
parent 3efe35d246
commit 752af86f2b
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ int sc_pkcs15_decode_aodf_entry(struct sc_pkcs15_card *p15card,
* derive it from the PKCS#15 context. */
if (!info.path.len) {
/* Give priority to AID defined in the application DDO */
if (p15card->app->ddo.aid.len) {
if (p15card->app && p15card->app->ddo.aid.len) {
memset(&info.path, 0, sizeof(struct sc_path));
info.path.type = SC_PATH_TYPE_DF_NAME;
memcpy(info.path.value, p15card->app->ddo.aid.value, p15card->app->ddo.aid.len);