X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fregex%2Fglob.c;h=67f84bcf0c0408fa90e8cefc284e6a1e8f4a7b7d;hp=9a70f0bc20911c441a660e4535deb6682154d8ea;hb=0dc99ac413d8bc054a2e95578475c7122455eee8;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 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)) {