diff options
author | Melvyn Sopacua <msopacua@php.net> | 2002-12-23 18:33:46 +0000 |
---|---|---|
committer | Melvyn Sopacua <msopacua@php.net> | 2002-12-23 18:33:46 +0000 |
commit | 0764c3101baf70ee368efa3ec42cfb5104e304e7 (patch) | |
tree | c10aee752d88621223e62432f2a4209d8558ec3a | |
parent | 0bb1ff71d650bbd8d8bdb12432988fd01a38edef (diff) | |
download | php-git-0764c3101baf70ee368efa3ec42cfb5104e304e7.tar.gz |
Verify if gl_pathv is not NULL, which it is, when GLOB_NOMATCH isn't
supported and there are no matches.
# BSDi/Mac OSX are affected.
-rw-r--r-- | ext/standard/dir.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/dir.c b/ext/standard/dir.c index 73374d0434..7778876c6e 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -400,6 +400,9 @@ PHP_FUNCTION(glob) /* we assume that any glob pattern will match files from one directory only so checking the dirname of the first match should be sufficient */ + if (!globbuf.gl_pathv) { + RETURN_FALSE; + } strncpy(cwd, globbuf.gl_pathv[0], MAXPATHLEN); if (PG(safe_mode) && (!php_checkuid(cwd, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { RETURN_FALSE; |