diff --git a/lib/fts.c b/lib/fts.c index 2d4e33321..5ea139700 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -291,6 +291,10 @@ fts_open (char * const *argv, __set_errno (EINVAL); return (NULL); } + if ( ! (options & (FTS_LOGICAL | FTS_PHYSICAL))) { + __set_errno (EINVAL); + return (NULL); + } /* Allocate/initialize the stream */ if ((sp = malloc(sizeof(FTS))) == NULL)