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:
parent
622607a68c
commit
90e967d042
|
@ -1049,7 +1049,7 @@ static int asn1_decode(struct sc_context *ctx, struct sc_asn1_entry *asn1,
|
||||||
asn1->name);
|
asn1->name);
|
||||||
return SC_ERROR_ASN1_OBJECT_NOT_FOUND;
|
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;
|
return SC_ERROR_ASN1_END_OF_CONTENTS;
|
||||||
|
|
||||||
for (idx = 0; asn1[idx].name != NULL; idx++) {
|
for (idx = 0; asn1[idx].name != NULL; idx++) {
|
||||||
|
|
Loading…
Reference in New Issue