From: Nikos Mavrogiannopoulos Date: Thu, 12 Nov 2020 15:00:24 +0000 (+0100) Subject: buf_tlv: corrected TLV decoding X-Git-Tag: v8.20~386^2~9 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=974ac99902a6bed2ec3972030194197fa48793d9;p=users%2Fdwmw2%2Fopenconnect.git buf_tlv: corrected TLV decoding Signed-off-by: Nikos Mavrogiannopoulos --- diff --git a/yubikey.c b/yubikey.c index 279c14f6..a7b90496 100644 --- a/yubikey.c +++ b/yubikey.c @@ -151,7 +151,7 @@ static int buf_tlv(struct oc_text_buf *buf, int *loc, unsigned char *type) return -EINVAL; len = (unsigned char)buf->data[(*loc)++]; len <<= 8; - len = (unsigned char)buf->data[(*loc)++]; + len |= (unsigned char)buf->data[(*loc)++]; left -= 2; }