[vlc-commits] directory: remove PATH_MAX limit (fixes #24754)
Rémi Denis-Courmont
git at videolan.org
Wed May 20 17:38:32 CEST 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed May 20 18:37:17 2020 +0300| [1e23e470e7d59e0376ba861fb83e5c0c92a40de2] | committer: Rémi Denis-Courmont
directory: remove PATH_MAX limit (fixes #24754)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e23e470e7d59e0376ba861fb83e5c0c92a40de2
---
modules/access/directory.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules/access/directory.c b/modules/access/directory.c
index 72182bd734..63ff7e96ff 100644
--- a/modules/access/directory.c
+++ b/modules/access/directory.c
@@ -135,10 +135,10 @@ int DirRead (stream_t *access, input_item_node_t *node)
if (fstatat(dirfd(sys->dir), entry, &st, 0))
continue;
#else
- char path[PATH_MAX];
+ char *path;
- if (snprintf(path, PATH_MAX, "%s"DIR_SEP"%s", access->psz_filepath,
- entry) >= PATH_MAX || vlc_stat(path, &st))
+ if (asprintf(&path, "%s"DIR_SEP"%s", access->psz_filepath, entry) == -1
+ || (type = vlc_stat(path, &st), free(path), type))
continue;
#endif
switch (st.st_mode & S_IFMT)
More information about the vlc-commits
mailing list