From 9d49f7f26139f41bdf2666f4284661491cf7dccd Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Tue, 28 Apr 2026 14:54:20 +0200 Subject: [PATCH] TLSX_GetSize: return error as soon as it happens --- src/tls.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tls.c b/src/tls.c index 9407cd42ce..f7dc51de0b 100644 --- a/src/tls.c +++ b/src/tls.c @@ -15145,6 +15145,9 @@ static int TLSX_GetSize(TLSX* list, byte* semaphore, byte msgType, break; } + if (ret != 0) + return ret; + /* Early exit: stop accumulating as soon as the running total * cannot possibly fit the 2-byte wire length. Check *before* * marking the extension as processed so the semaphore is not