summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-06-01 10:58:35 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-06-01 10:58:35 +0000
commitabc357f832db2162bfaf576a98c93186ac695b29 (patch)
tree18037fa08d70ec0cd3d4e5e82aee4560ec5fe47b
parente8936ca7b6fa8ccadd7d90582cca857412eb3f84 (diff)
Fix off-by-one in MAX_MANIFEST_ENTRIES check
ok claudio job
-rw-r--r--usr.sbin/rpki-client/mft.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rpki-client/mft.c b/usr.sbin/rpki-client/mft.c
index fe90909c647..289e35cc44d 100644
--- a/usr.sbin/rpki-client/mft.c
+++ b/usr.sbin/rpki-client/mft.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mft.c,v 1.69 2022/05/31 18:51:35 tb Exp $ */
+/* $OpenBSD: mft.c,v 1.70 2022/06/01 10:58:34 tb Exp $ */
/*
* Copyright (c) 2022 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -323,7 +323,7 @@ mft_parse_econtent(const unsigned char *d, size_t dsz, struct parse *p)
goto out;
}
- if (sk_FileAndHash_num(mft->fileList) > MAX_MANIFEST_ENTRIES) {
+ if (sk_FileAndHash_num(mft->fileList) >= MAX_MANIFEST_ENTRIES) {
warnx("%s: %d exceeds manifest entry limit (%d)", p->fn,
sk_FileAndHash_num(mft->fileList), MAX_MANIFEST_ENTRIES);
goto out;