mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2026-01-01 01:41:18 +01:00
Merge pull request #12088 from nmeum/pr/gnrc_tcp_option_overflow
gnrc_tcp: fix integer underflow in option parser
This commit is contained in:
commit
7d3f20b1a8
@ -64,6 +64,12 @@ int _option_parse(gnrc_tcp_tcb_t *tcb, tcp_hdr_t *hdr)
|
||||
DEBUG("gnrc_tcp_option.c : _option_parse() : Unknown option found.\
|
||||
KIND=%"PRIu8", LENGTH=%"PRIu8"\n", option->kind, option->length);
|
||||
}
|
||||
|
||||
if (option->length > opt_left) {
|
||||
DEBUG("gnrc_tcp_option.c : _option_parse() : invalid option length\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
opt_ptr += option->length;
|
||||
opt_left -= option->length;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user