From f49eaaf690afb4f5b9fc56e4ca35e04277c3f012 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Thu, 17 Feb 2022 18:22:05 +0100 Subject: ipcpd: Fix bounds check on PROG_MAX_FLOWS Off-by-one error in the bounds check. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/unicast/fa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ipcpd/unicast/fa.c') diff --git a/src/ipcpd/unicast/fa.c b/src/ipcpd/unicast/fa.c index 5edf77aa..ef6adae6 100644 --- a/src/ipcpd/unicast/fa.c +++ b/src/ipcpd/unicast/fa.c @@ -143,7 +143,7 @@ static int fa_rib_read(const char * path, fd = atoi(entry); - if (fd < 0 || fd > PROG_MAX_FLOWS) + if (fd < 0 || fd >= PROG_MAX_FLOWS) return -1; if (len < 1536) @@ -303,7 +303,7 @@ static int eid_to_fd(uint64_t eid) fd = eid & 0xFFFFFFFF; - if (fd < 0 || fd > PROG_MAX_FLOWS) + if (fd < 0 || fd >= PROG_MAX_FLOWS) return -1; flow = &fa.flows[fd]; -- cgit v1.2.3