mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 06:14:35 +00:00
zebra: untrusted array index (2) (Coverity 1470113)
This is a correction over 7f61ea7bd4
in order
to avoid the TAINTED_SCALAR Coverity warning (ending in "Untrusted array
index read"). This is equivalent to the previous commit, but avoiding
pointer arithmetic with tainted variables.
Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
parent
7f61ea7bd4
commit
45981fda06
@ -212,7 +212,9 @@ 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)]) {
|
||||
|
||||
if (offsetof(struct inotify_event, name) + event->len
|
||||
>= sizeof(buf)) {
|
||||
zlog_err("NS notify read: buffer underflow");
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user