]> git.ipfire.org Git - thirdparty/libarchive.git/commit
setup_current_filesystem: fail if name_max is 0
authorLuke Mewburn <Luke@Mewburn.net>
Sat, 10 Jun 2023 10:44:52 +0000 (11:44 +0100)
committerMartin Matuška <martin@matuska.de>
Thu, 13 Jul 2023 22:12:05 +0000 (00:12 +0200)
commitdc56a48d90973bc9c876e97b41b2ed35d04d81f5
treead8a71f21eaec908094ec1a84eb7a4dc0d3f69d7
parentd955533a6fccac1c1b783e3b0bf8bde8600f1237
setup_current_filesystem: fail if name_max is 0

Add error handling to the USE_READDIR_R code paths that set name_max
from struct statfs or statvfs; if the determined name_max == 0
then return an error.

Avoids a crash in tree_dir_next_posix() when the calculation of
dirent_size from name_max is too small for the memory allocated
for struct dirent.

This may fix Github issue #1149
This may fix NetBSD PR https://gnats.netbsd.org/56080
libarchive/archive_read_disk_posix.c