-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
d71b056
commit 29d5a14
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters