[riot-notifications] [RIOT-OS/RIOT] gnrc_tcp: check if option length field is present before accessing it (#12249)

nmeum notifications at github.com
Mon Sep 16 14:07:27 CEST 2019


TCP options have a maximum size of 3 byte (kind, length, value). The
current code only checks for the presence of the first field. Before
accessing the second field (length) the code must ensure that a length
field is even present.

**Discussion:** Change is somewhat ugly as it introduces a magic constant.
The proper way of solving this would probably be not using a packed struct
to parse these variable-length options.
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/12249

-- Commit Summary --

  * gnrc_tcp: check if option length field is present before accessing it

-- File Changes --

    M sys/net/gnrc/transport_layer/tcp/gnrc_tcp_option.c (4)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/12249.patch
https://github.com/RIOT-OS/RIOT/pull/12249.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/12249
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190916/548514e6/attachment.htm>


More information about the notifications mailing list