Fix: stop parsing at the end of the file, not when finding padding bytes

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2103 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
sth 2005-01-27 21:35:23 +00:00
parent 622607a68c
commit 90e967d042
1 changed files with 1 additions and 1 deletions

View File

@ -1049,7 +1049,7 @@ static int asn1_decode(struct sc_context *ctx, struct sc_asn1_entry *asn1,
asn1->name);
return SC_ERROR_ASN1_OBJECT_NOT_FOUND;
}
if (p[0] == 0 || p[0] == 0xFF)
if (p[0] == 0 || p[0] == 0xFF || len == 0)
return SC_ERROR_ASN1_END_OF_CONTENTS;
for (idx = 0; asn1[idx].name != NULL; idx++) {