projects
/
systemd
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
82e00a3
)
exec-invoke: correct dont_close[] size
author
Lennart Poettering
<lennart@poettering.net>
Tue, 23 Apr 2024 19:49:12 +0000
(21:49 +0200)
committer
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Wed, 24 Apr 2024 13:09:28 +0000
(15:09 +0200)
THis needs 15 entries as far as I can count, not just 14.
Follow-up for:
5686391b006ee82d8a4559067ad9818e3e631247
Sniff.
src/core/exec-invoke.c
patch
|
blob
|
history
diff --git
a/src/core/exec-invoke.c
b/src/core/exec-invoke.c
index ff0fdbec5ff8f719af7b489af620c240c9067596..8b16acb399ca9457ce84c456d06fc4c485f9590f 100644
(file)
--- 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 + 1
4
];
+ int dont_close[n_fds + 1
5
];
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);
}