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)
(cherry picked from commit 8f4dab0)
  • Loading branch information
poettering authored and bluca committed Apr 24, 2024
1 parent 2012a6c commit d9c3ae2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -4402,7 +4402,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 @@ -4438,6 +4438,8 @@ static int close_remaining_fds(
if (user_lookup_fd >= 0)
dont_close[n_dont_close++] = 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 d9c3ae2

Please sign in to comment.