[PATCH] Babel: Fix pointer arithmetic in subtlv parsing

Martin Mares mj at ucw.cz
Thu Jun 15 08:38:16 CEST 2017


Hello, world!\n

>    for (tlv = (void *) hdr + state->current_tlv_endpos;
> -       tlv < hdr + TLV_LENGTH(hdr);
> +       (void *) tlv < (void *) hdr + TLV_LENGTH(hdr);
>         tlv = NEXT_TLV(tlv))

BTW, is there any reason for doing that pointer arithmetics
on void pointers instead of char pointers? It looks like
an unnecessary GCCism.

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj at ucw.cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
DRM 'manages access' in the same way that jail 'manages freedom.'


More information about the Bird-users mailing list