From 13e7b4726cd920caaeef0b8aa2effac78e08741a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 25 Nov 2022 08:43:06 -0500 Subject: Fix potential out of bounds read --- src/errno_status.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/errno_status.c b/src/errno_status.c index 4922b56..887158f 100644 --- a/src/errno_status.c +++ b/src/errno_status.c @@ -41,7 +41,7 @@ zix_errno_status(const int e) {0, ZIX_STATUS_ERROR}, // Fallback mapping }; - static const size_t n_mappings = sizeof(map) / sizeof(Mapping); + static const size_t n_mappings = sizeof(map) / sizeof(Mapping) - 1U; // Find the index of the matching mapping (or leave it at the fallback entry) size_t m = 0; -- cgit v1.2.1