From 1c121b1430640d5591af2d6c3287b74801c2f942 Mon Sep 17 00:00:00 2001 From: aj Date: Sun, 27 Apr 2003 15:05:03 +0000 Subject: [PATCH] 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 --- src/libopensc/asn1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libopensc/asn1.c b/src/libopensc/asn1.c index d6ade8a9..5ae413a5 100644 --- a/src/libopensc/asn1.c +++ b/src/libopensc/asn1.c @@ -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];