commit b78d114f68f777123d85ca1094e5630031178d67
parent 46238adcde98353a4aaa829066091f79e3437a70
Author: Jan Pobrislo <ccx@te2000.cz>
Date: Thu, 11 Dec 2025 20:47:46 +0000
lns-lockdown: fix off-by-one in argv handling
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/lns-lockdown_main.c b/src/lns-lockdown_main.c
@@ -264,7 +264,7 @@ int main (int argc, char const *const *argv) {
if (argc < 3) {
dieusage();
}
- pivot_and_umount(argv[1], argv[2], &unex);
+ pivot_and_umount(argv[0], argv[1], &unex);
if (drop_privs) {
drop(&privs);
} else if (seccomp_fd >= 0) {
@@ -280,5 +280,5 @@ int main (int argc, char const *const *argv) {
strerr_diefu2sys(111, "chdir to ", chdir_to);
}
}
- xmexec_n(&argv[3], unex.sa.s, unex.sa.len, unex.count);
+ xmexec_n(&argv[2], unex.sa.s, unex.sa.len, unex.count);
}