zebra: untrusted array index (Coverity 1470113)

This is a correction over 32ac96b2ba, so
removing the forced string null termination doesn't involve a worse situation
than before (the underflow check should protect for the case of receiving
an incomplete buffer, which would be the cause of non-zero terminated string)

Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
paco 2018-06-20 19:25:06 +02:00
parent 76cd18c9dd
commit 7f61ea7bd4
No known key found for this signature in database
GPG Key ID: FD112A8C7E6A5E4A

View File

@ -216,7 +216,6 @@ static int zebra_ns_notify_read(struct thread *t)
zlog_err("NS notify read: buffer underflow");
break;
}
event->name[event->len] = 0;
netnspath = ns_netns_pathname(NULL, event->name);
if (!netnspath)
continue;