From fd8772ac3fd89fce5a0c26c59163c0ccd91aed7b Mon Sep 17 00:00:00 2001 From: Loganaden Velvindron Date: Fri, 3 Jul 2026 03:57:58 +0400 Subject: [PATCH] quic: Fix buffer underflow --- src/quic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/quic.c b/src/quic.c index d178f66bce..dcdec84afe 100644 --- a/src/quic.c +++ b/src/quic.c @@ -852,6 +852,11 @@ static int wolfSSL_quic_send_internal(WOLFSSL* ssl) rl = (RecordLayerHeader*)output; ato16(rl->length, &rlen); output += RECORD_HEADER_SZ; + if (length < RECORD_HEADER_SZ) { + WOLFSSL_MSG("WOLFSSL_QUIC_SEND application failed"); + ret = FWRITE_ERROR; + goto cleanup; + } length -= RECORD_HEADER_SZ; ssl->quic.output_rec_remain = rlen; ssl->quic.output_rec_level = ssl->quic.enc_level_write;