pkcs15-data: Do not fail on zero-lenght data blocks

This commit is contained in:
Jakub Jelen 2020-09-07 12:59:45 +02:00 committed by Jakub Jelen
parent a626c63d91
commit cf66cf1416
1 changed files with 2 additions and 3 deletions

View File

@ -57,9 +57,8 @@ sc_pkcs15_read_data_object(struct sc_pkcs15_card *p15card,
LOG_TEST_RET(ctx, r, "Cannot get DATA object data");
}
sc_der_copy(&der, &info->data);
if (!der.value)
LOG_TEST_RET(ctx, SC_ERROR_OUT_OF_MEMORY, "Cannot allocate memory for der value");
r = sc_der_copy(&der, &info->data);
LOG_TEST_RET(ctx, r, "Cannot allocate memory for der value");
data_object = calloc(sizeof(struct sc_pkcs15_data), 1);
if (!data_object) {