Only look at first byte for end of data detection.

That way not only 0,0 and ff,ff is recognized
and 0,ff,ff,ff... will not cause trouble.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1073 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2003-04-27 15:05:03 +00:00
parent 07668a30ff
commit 1c121b1430
1 changed files with 1 additions and 1 deletions

View File

@ -1036,7 +1036,7 @@ static int asn1_decode(struct sc_context *ctx, struct sc_asn1_entry *asn1,
else
return 0;
}
if ((p[0] == 0 && p[1] == 0) || (p[0] == 0xFF && p[1] == 0xFF))
if (p[0] == 0 || p[0] == 0xFF)
return SC_ERROR_ASN1_END_OF_CONTENTS;
for (idx = 0; asn1[idx].name != NULL; idx++) {
entry = &asn1[idx];