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.
  • Loading branch information
poettering authored and keszybz committed Apr 24, 2024
1 parent 82e00a3 commit 0729654
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 @@ -3519,7 +3519,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 @@ -3555,6 +3555,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 0729654

Please sign in to comment.