From 9a02bf17dcc86efeb8b61ae68fbbb597bcd40b86 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 1 Jun 2022 10:58:34 +0000 Subject: [PATCH] Fix off-by-one in MAX_MANIFEST_ENTRIES check ok claudio job --- usr.sbin/rpki-client/mft.c | 4 ++-- 1 file 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 * Copyright (c) 2019 Kristaps Dzonsons @@ -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; -- 2.20.1