]> git.puffer.fish Git - matthieu/frr.git/commit
pbrd: Fix nearly impossible truncation
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 3 May 2018 00:12:31 +0000 (20:12 -0400)
committerMartin Winter <mwinter@opensourcerouting.org>
Mon, 4 Jun 2018 00:19:51 +0000 (17:19 -0700)
commitb915220d6dd997c2de85daf4ec3f86a354447632
tree1376a6d22842c932bb6744aa523ce327ff161e11
parent987fbd7d38052b8c25f9bda9bd36f4200f1340b1
pbrd: Fix nearly impossible truncation

Since we are writing into the name field which is PBR_MAP_NAMELEN
size, we are expecting this to field to be at max 100 bytes.
Newer compilers understand that the %s portion may be up to
100 bytes( because of the size of the string.  The %u portion
is expected to be 10 bytes.  So in `theory` there are situations
where we might truncate.  The reality this is never going to
happen( who is going to create a nexthop group name that is
over say 30 characters? ).  As such we are expecting the
calling function to subtract 10 from the size_t l before
we pass it in to get around this new gcc fun.

Fixes: #2163
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pbrd/pbr_nht.c
pbrd/pbr_vty.c