1
0
Fork 0
mirror of https://passt.top/passt synced 2025-05-29 12:35:33 +02:00

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 <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2025-02-12 01:07:33 +01:00
parent def7de4690
commit 836fe215e0

View file

@ -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;