commit a92aafd1ac414e6276b010015dfc0f80cfc40d1a
parent c3838c58b485225753db7b0db5a0bc6eb9fdd9ce
Author: Jan Pobrislo <ccx@te2000.cz>
Date: Fri, 12 Dec 2025 02:04:50 +0000
fix path verification loop
Diffstat:
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/lns-lockdown_main.c b/src/lns-lockdown_main.c
@@ -67,16 +67,13 @@ void pivot_and_umount(
) {
size_t newroot_len = 0;
for(size_t char_n=0; new_root[char_n]; char_n++) {
- if(new_root[char_n] == 0) {
- newroot_len = char_n;
- break;
- }
if(new_root[char_n] != put_old[char_n]) {
strerr_dief1x(100, "first path is not prefix of second path");
}
if(char_n > PATH_MAX) {
strerr_dief1x(111, "realpath() returned invalid string");
}
+ newroot_len = char_n;
}
if(newroot_len == 0) {
strerr_dief1x(111, "got empty path?");