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

Simon Brummer notifications at github.com
Mon Sep 16 19:26:41 CEST 2019


Hi nmeum,

Good catch again. First of all TCP options do not have a length maximum size of three bytes as stated in the PR descriptions.

Supported Options introduced with the original TCP have either a single Byte (EOL and NOP) or four Bytes (MSS). Additional TCP extensions introduce options with variable length. That been said you are right, the length field must be checked before access. 

Now to your PR. The Logic is fine, but usage of a magic numbers 
goes against the RIOT Styleguide. However you could place a constant in 'sys/include/net/tcp.h' and use it in the affected code segment.

If you change that you get my ACK.

Cheers SImon

-- 
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#issuecomment-531875928
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190916/ddc547d9/attachment.htm>


More information about the notifications mailing list