diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 25f96064e9c..58f3cd8ee19 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -401,7 +401,7 @@ PHP_FUNCTION(glob) #ifndef GLOB_NOMATCH /* now catch the FreeBSD style of "no matches" */ - if (!globbuf.gl_pathc) { + if (!globbuf.gl_pathc || !globbuf.gl_pathv) { array_init(return_value); return; }