From 9b2023c7ae47e82ba97a0e778f503a8f8467bc4f Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Wed, 17 Jan 2018 00:28:05 +0100 Subject: [PATCH] SimpleTLV: Skip correctly two bytes after reading 2b size (#1231) --- src/libopensc/simpletlv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libopensc/simpletlv.c b/src/libopensc/simpletlv.c index f526a1cd..ab0401b5 100644 --- a/src/libopensc/simpletlv.c +++ b/src/libopensc/simpletlv.c @@ -90,8 +90,9 @@ sc_simpletlv_read_tag(u8 **buf, size_t buflen, u8 *tag_out, size_t *taglen) *taglen = 0; return SC_ERROR_INVALID_ARGUMENTS; } + /* skip two bytes (the size) */ len = lebytes2ushort(p); - p++; + p+=2; } *taglen = len; *buf = p;