summaryrefslogtreecommitdiff
path: root/src/ipcpd/unicast
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-02-17 18:22:05 +0100
committerSander Vrijders <sander@ouroboros.rocks>2022-02-18 08:43:14 +0100
commitf49eaaf690afb4f5b9fc56e4ca35e04277c3f012 (patch)
treeb058c6a34ceed1abfbe0a10717e2933adb5c2e08 /src/ipcpd/unicast
parent926e7d76cd290726fc0bccd00b58efda6f01b727 (diff)
downloadouroboros-f49eaaf690afb4f5b9fc56e4ca35e04277c3f012.tar.gz
ouroboros-f49eaaf690afb4f5b9fc56e4ca35e04277c3f012.zip
ipcpd: Fix bounds check on PROG_MAX_FLOWS
Off-by-one error in the bounds check. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/ipcpd/unicast')
-rw-r--r--src/ipcpd/unicast/fa.c4
1 files changed, 2 insertions, 2 deletions
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];