From 836fe215e049ee423750d3315a02742d8224eab2 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Wed, 12 Feb 2025 01:07:33 +0100 Subject: passt-repair: Fix off-by-one in check for number of file descriptors Actually, 254 is too many, but 253 isn't. Signed-off-by: Stefano Brivio --- passt-repair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passt-repair.c b/passt-repair.c index 614cee0..1174ae3 100644 --- a/passt-repair.c +++ b/passt-repair.c @@ -131,7 +131,7 @@ loop: /* No inverse formula for CMSG_LEN(x), and building one with CMSG_LEN(0) * works but there's no guarantee it does. Search the whole domain. */ - for (i = 1; i < SCM_MAX_FD; i++) { + for (i = 1; i <= SCM_MAX_FD; i++) { if (CMSG_LEN(sizeof(int) * i) == cmsg->cmsg_len) { n = i; break; -- cgit v1.2.3