]> granicus.if.org Git - php/commitdiff
Verify if gl_pathv is not NULL, which it is, when GLOB_NOMATCH isn't
authorMelvyn Sopacua <msopacua@php.net>
Mon, 23 Dec 2002 18:33:46 +0000 (18:33 +0000)
committerMelvyn Sopacua <msopacua@php.net>
Mon, 23 Dec 2002 18:33:46 +0000 (18:33 +0000)
supported and there are no matches.

# BSDi/Mac OSX are affected.

ext/standard/dir.c

index 73374d04340ed4a946e2b4c3b9a0a45cfe2d89c1..7778876c6ed4845c6b07239794ab8b4f7e6965c0 100644 (file)
@@ -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;