From: paco Date: Wed, 27 Jun 2018 10:43:43 +0000 (+0200) Subject: lib zebra: str-z check (2) (Coverity 1465494) X-Git-Tag: frr-6.1-dev~233^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=b6312ad1857ba6260c52204d5452bfbf1a611757;p=matthieu%2Ffrr.git lib zebra: str-z check (2) (Coverity 1465494) This is an additional correction after 45981fda0634f7277c27c2a55e30d7f3433ffa16 / PR #2462. I hope this fixes the Coverity warning (I've added an additional check for ensuring the string provided by the inotify read is zero-terminated). Signed-off-by: F. Aragon --- diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c index a391f8343f..d0ea661403 100644 --- a/zebra/zebra_netns_notify.c +++ b/zebra/zebra_netns_notify.c @@ -218,6 +218,12 @@ static int zebra_ns_notify_read(struct thread *t) zlog_err("NS notify read: buffer underflow"); break; } + + if (strnlen(event->name, event->len) == event->len) { + zlog_err("NS notify error: bad event name"); + break; + } + netnspath = ns_netns_pathname(NULL, event->name); if (!netnspath) continue;