From: Lennart Poettering Date: Tue, 23 Apr 2024 19:49:12 +0000 (+0200) Subject: exec-invoke: correct dont_close[] size X-Git-Tag: v256-rc1~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07296542d636dcac43f6c9ee45a638fca8c5f3dd;p=thirdparty%2Fsystemd.git exec-invoke: correct dont_close[] size THis needs 15 entries as far as I can count, not just 14. Follow-up for: 5686391b006ee82d8a4559067ad9818e3e631247 Sniff. --- diff --git a/src/core/exec-invoke.c b/src/core/exec-invoke.c index ff0fdbec5ff..8b16acb399c 100644 --- a/src/core/exec-invoke.c +++ b/src/core/exec-invoke.c @@ -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); @@ -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); }