Skip to content

Commit 8f4dab0

Browse files
poetteringkeszybz
authored andcommitted
exec-invoke: correct dont_close[] size
THis needs 15 entries as far as I can count, not just 14. Follow-up for: 5686391 Sniff. (cherry picked from commit 0729654)
1 parent d1a7ffc commit 8f4dab0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/core/exec-invoke.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3459,7 +3459,7 @@ static int close_remaining_fds(
34593459
const int *fds, size_t n_fds) {
34603460

34613461
size_t n_dont_close = 0;
3462-
int dont_close[n_fds + 14];
3462+
int dont_close[n_fds + 15];
34633463

34643464
assert(params);
34653465

@@ -3495,6 +3495,8 @@ static int close_remaining_fds(
34953495
if (params->user_lookup_fd >= 0)
34963496
dont_close[n_dont_close++] = params->user_lookup_fd;
34973497

3498+
assert(n_dont_close <= ELEMENTSOF(dont_close));
3499+
34983500
return close_all_fds(dont_close, n_dont_close);
34993501
}
35003502

0 commit comments

Comments
 (0)