Skip to content

Commit

Permalink
exec-invoke: correct dont_close[] size
Browse files Browse the repository at this point in the history
THis needs 15 entries as far as I can count, not just 14.

Follow-up for: 5686391

Sniff.

(cherry picked from commit 0729654)
  • Loading branch information
poettering authored and keszybz committed Apr 24, 2024
1 parent d1a7ffc commit 8f4dab0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/exec-invoke.c
Original file line number Diff line number Diff line change
Expand Up @@ -3459,7 +3459,7 @@ static int close_remaining_fds(
const int *fds, size_t n_fds) {

size_t n_dont_close = 0;
int dont_close[n_fds + 14];
int dont_close[n_fds + 15];

assert(params);

Expand Down Expand Up @@ -3495,6 +3495,8 @@ static int close_remaining_fds(
if (params->user_lookup_fd >= 0)
dont_close[n_dont_close++] = params->user_lookup_fd;

assert(n_dont_close <= ELEMENTSOF(dont_close));

return close_all_fds(dont_close, n_dont_close);
}

Expand Down

0 comments on commit 8f4dab0

Please sign in to comment.