summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaco <paco@voltanet.io>2018-06-15 16:16:11 +0200
committerpaco <paco@voltanet.io>2018-06-19 14:53:31 +0200
commit32ac96b2ba9693696d2f1156af1b80985d4e55bb (patch)
tree8c8f51e7786885b443acaab3617578e4fa9ee853
parente4a374681d83a495472500a9a3dbeee12de089f8 (diff)
zebra: string null termination (Coverity 1465494)
Signed-off-by: F. Aragon <paco@voltanet.io>
-rw-r--r--zebra/zebra_netns_notify.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/zebra/zebra_netns_notify.c b/zebra/zebra_netns_notify.c
index 30f850597c..bb6a565211 100644
--- a/zebra/zebra_netns_notify.c
+++ b/zebra/zebra_netns_notify.c
@@ -212,6 +212,11 @@ static int zebra_ns_notify_read(struct thread *t)
continue;
if (event->mask & IN_DELETE)
return zebra_ns_delete(event->name);
+ if (&event->name[event->len] >= &buf[sizeof(buf)]) {
+ zlog_err("NS notify read: buffer underflow");
+ break;
+ }
+ event->name[event->len] = 0;
netnspath = ns_netns_pathname(NULL, event->name);
if (!netnspath)
continue;