Merge pull request #29327 from aiburegit/main

rootless: fix heap-buffer-overflow in preexec hooks
This commit is contained in:
Matt Heon 2026-08-04 20:42:07 -04:00 committed by GitHub
commit de06abeb56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -447,7 +447,6 @@ do_preexec_hooks_dir (const char *dir, char **argv, int argc)
strncpy (buffer + nfiles * (NAME_MAX + 1), de->d_name, NAME_MAX + 1);
nfiles++;
buffer[nfiles * (NAME_MAX + 1)] = '\0';
}
qsort (buffer, nfiles, NAME_MAX + 1, (int (*)(const void *, const void *)) strcmp);