summaryrefslogtreecommitdiff
path: root/src/regex/glob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regex/glob.c')
-rw-r--r--src/regex/glob.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/regex/glob.c b/src/regex/glob.c
index 9a70f0bc..67f84bcf 100644
--- a/src/regex/glob.c
+++ b/src/regex/glob.c
@@ -171,6 +171,8 @@ int glob(const char *pat, int flags, int (*errfunc)(const char *path, int err),
d = "";
}
+ if (strlen(p) > PATH_MAX) return GLOB_NOSPACE;
+
if (!errfunc) errfunc = ignore_err;
if (!(flags & GLOB_APPEND)) {