From 293d02ea4ba834a5b7196952ebe2d4b546dd54de Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Wed, 13 Sep 2017 10:26:23 +0200 Subject: [PATCH] removed unused test test is performed by sc_asn1_read_tag --- src/libopensc/asn1.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libopensc/asn1.c b/src/libopensc/asn1.c index d3d1b87e..93d80b7a 100644 --- a/src/libopensc/asn1.c +++ b/src/libopensc/asn1.c @@ -351,10 +351,6 @@ const u8 *sc_asn1_find_tag(sc_context_t *ctx, const u8 * buf, /* read a tag */ if (sc_asn1_read_tag(&p, left, &cla, &tag, &taglen) != SC_SUCCESS) return NULL; - if (left < (size_t)(p - buf)) { - sc_debug(ctx, SC_LOG_DEBUG_ASN1, "invalid TLV object\n"); - return NULL; - } left -= (p - buf); /* we need to shift the class byte to the leftmost * byte of the tag */ @@ -371,10 +367,6 @@ const u8 *sc_asn1_find_tag(sc_context_t *ctx, const u8 * buf, return p; } /* otherwise continue reading tags */ - if (left < taglen) { - sc_debug(ctx, SC_LOG_DEBUG_ASN1, "invalid TLV object\n"); - return NULL; - } left -= taglen; p += taglen; }