Message ID | ZmPTPb1C0hZYZQPE@gondor.apana.org.au (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Herbert Xu |
Headers | show |
Series | [v2] expand: Check d_type in expmeta before recursing | expand |
diff --git a/src/expand.c b/src/expand.c index 345c498..6912e39 100644 --- a/src/expand.c +++ b/src/expand.c @@ -1722,6 +1722,9 @@ static char *expmeta(char *name, unsigned name_len, size_t expdir_len) if (*dname == '.' && !matchdot) goto check_int; + if (c && dp->d_type != DT_DIR && dp->d_type != DT_LNK && + dp->d_type != DT_UNKNOWN) + goto check_int; len = strlen(dname) + 1; p = dname; if (!FNMATCH_IS_ENABLED) {