Skip to content

Commit

Permalink
Correct the MSS option size check
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixSchladt authored and danielinux committed Feb 19, 2024
1 parent 4fc5c7c commit 123cfe3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/pico_tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 123cfe3

Please sign in to comment.