From 123cfe3ab499f0d7805aa64c43070c1cc856cd86 Mon Sep 17 00:00:00 2001 From: Felix Schladt <82309717+FelixSchladt@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:28:50 +0100 Subject: [PATCH] Correct the MSS option size check --- modules/pico_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/pico_tcp.c b/modules/pico_tcp.c index f24ee3db..7bcefe3c 100644 --- a/modules/pico_tcp.c +++ b/modules/pico_tcp.c @@ -868,7 +868,7 @@ static inline void tcp_parse_option_mss(struct pico_socket_tcp *t, uint8_t len, if (tcpopt_len_check(idx, len, PICO_TCPOPTLEN_MSS) < 0) return; - if ((*idx + PICO_TCPOPTLEN_MSS) > len) + if ((*idx + PICO_TCPOPTLEN_MSS - 2) > len) return; t->mss_ok = 1;