zebra: Possible write beyond buffer length

Prevent string manipulation where we might have data
passed into that is larger than the buffer we are pushing into.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2020-07-18 09:45:08 -04:00
parent 55528234ea
commit f177a83efc

View File

@ -185,7 +185,7 @@ static bool zebra_ns_notify_is_default_netns(const char *name)
{ {
struct stat default_netns_stat; struct stat default_netns_stat;
struct stat st; struct stat st;
char netnspath[64]; char netnspath[PATH_MAX];
if (zebra_ns_notify_self_identify(&default_netns_stat)) if (zebra_ns_notify_self_identify(&default_netns_stat))
return false; return false;