oberthur: Once again, fix the error check

The shared codition was executed but the condition in LOG_TEST_RET
was not met in case of the acl was null.

Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25962
This commit is contained in:
Jakub Jelen 2020-11-16 13:55:04 +01:00 committed by Frank Morgner
parent 5eccebb4ee
commit c8b2e82713
1 changed files with 8 additions and 1 deletions

View File

@ -306,8 +306,15 @@ sc_oberthur_read_file(struct sc_pkcs15_card *p15card, const char *in_path,
const struct sc_acl_entry *acl = sc_file_get_acl_entry(file, SC_AC_OP_READ);
int ii;
if (acl == NULL) {
sc_file_free(file);
free(*out);
*out = NULL;
LOG_FUNC_RETURN(ctx, SC_ERROR_INVALID_DATA);
}
rv = sc_pkcs15_get_objects(p15card, SC_PKCS15_TYPE_AUTH_PIN, objs, 0x10);
if (rv != SC_SUCCESS || acl == NULL) {
if (rv != SC_SUCCESS) {
sc_file_free(file);
free(*out);
*out = NULL;