From 7e8807e054ba45545705d08401b1033dce27b364 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 8 Jul 2024 10:53:19 +0200 Subject: [PATCH] Fix potential infinite loop when bad ASN1 is processed. Signed-off-by: Pol Henarejos --- src/asn1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asn1.c b/src/asn1.c index 41c25ba..29937c2 100644 --- a/src/asn1.c +++ b/src/asn1.c @@ -42,7 +42,7 @@ uint16_t asn1_len(asn1_ctx_t *ctx) { uint32_t asn1_get_uint(asn1_ctx_t *ctx) { uint32_t d = ctx->data[0]; - for (uint8_t lt = 1; lt < MIN(ctx->len, sizeof(uint32_t)); lt++) { + for (uint16_t lt = 1; lt < MIN(ctx->len, sizeof(uint32_t)); lt++) { d <<= 8; d |= ctx->data[lt]; }