From 758e301f0c9a9885c1b716195df5fe6d6ac9d53e Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Mon, 3 Aug 2026 14:19:13 -0300 Subject: [PATCH] fix too short length guard --- mongoose.c | 2 +- src/tls_builtin.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index 76d1e4fa..c2a6fd4f 100644 --- a/mongoose.c +++ b/mongoose.c @@ -16904,7 +16904,7 @@ static int mg_tls_recv_record(struct mg_connection *c) { msgsz = MG_LOAD_BE16(rio->buf + 3); msg = rio->buf + 5; - if (msgsz < 16) { + if (msgsz < 17) { mg_error(c, "wrong size"); return -1; } diff --git a/src/tls_builtin.c b/src/tls_builtin.c index 269098e2..bfd22ce6 100644 --- a/src/tls_builtin.c +++ b/src/tls_builtin.c @@ -559,7 +559,7 @@ static int mg_tls_recv_record(struct mg_connection *c) { msgsz = MG_LOAD_BE16(rio->buf + 3); msg = rio->buf + 5; - if (msgsz < 16) { + if (msgsz < 17) { mg_error(c, "wrong size"); return -1; }