msopacua                Tue Dec 24 10:04:10 2002 EDT

  Modified files:              (Branch: PHP_4_3)
    /php4/ext/standard  dir.c 
  Log:
  MFH: crash fix in glob() with no results
  
  
Index: php4/ext/standard/dir.c
diff -u php4/ext/standard/dir.c:1.109.2.1 php4/ext/standard/dir.c:1.109.2.2
--- php4/ext/standard/dir.c:1.109.2.1   Thu Nov 14 17:51:21 2002
+++ php4/ext/standard/dir.c     Tue Dec 24 10:04:10 2002
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: dir.c,v 1.109.2.1 2002/11/14 22:51:21 ssb Exp $ */
+/* $Id: dir.c,v 1.109.2.2 2002/12/24 15:04:10 msopacua Exp $ */
 
 /* {{{ includes/startup/misc */
 
@@ -400,6 +400,9 @@
 
        /* 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;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to