msopacua Mon Dec 23 13:33:47 2002 EDT
Modified files:
/php4/ext/standard dir.c
Log:
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.
Index: php4/ext/standard/dir.c
diff -u php4/ext/standard/dir.c:1.111 php4/ext/standard/dir.c:1.112
--- php4/ext/standard/dir.c:1.111 Fri Nov 15 02:21:33 2002
+++ php4/ext/standard/dir.c Mon Dec 23 13:33:46 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: dir.c,v 1.111 2002/11/15 07:21:33 sniper Exp $ */
+/* $Id: dir.c,v 1.112 2002/12/23 18:33:46 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