From 8878922f95fca05628c99e2b35698c7b6df939dc Mon Sep 17 00:00:00 2001 From: Marco Oliverio Date: Mon, 1 Aug 2022 14:23:16 +0200 Subject: [PATCH] fix: dtls13: use correct buffer index to get epoch bits Fixes: d0796627651674c0d1c24e6f60f1fb8fb5db6665 --- src/internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 088161390..dc4089bc2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -9701,7 +9701,7 @@ static int GetDtls13RecordHeader(WOLFSSL* ssl, const byte* input, if (readSize < DTLS_UNIFIED_HEADER_MIN_SZ) return BUFFER_ERROR; - epochBits = *input & EE_MASK; + epochBits = *(input + *inOutIdx) & EE_MASK; ret = Dtls13ReconstructEpochNumber(ssl, epochBits, &epochNumber); if (ret != 0) return ret;