diff options
author | Melvyn Sopacua <msopacua@php.net> | 2002-12-24 15:04:10 +0000 |
---|---|---|
committer | Melvyn Sopacua <msopacua@php.net> | 2002-12-24 15:04:10 +0000 |
commit | 409f64d09dc524f496e9e4f59dc61223ee2fff06 (patch) | |
tree | 2c4d4e1dfb92f9494c66b690c9b779b7426c0729 | |
parent | 536771004515cd828d7c0de6faba421d5a124076 (diff) | |
download | php-git-409f64d09dc524f496e9e4f59dc61223ee2fff06.tar.gz |
MFH: crash fix in glob() with no results
-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 d0e8c042b5..1a7aa81e5d 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; |