summaryrefslogtreecommitdiff
path: root/ext/standard/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/file.c')
-rw-r--r--ext/standard/file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 0bfe060f2..fc16ab98b 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c 294896 2010-02-11 18:03:57Z johannes $ */
+/* $Id: file.c 298882 2010-05-02 20:11:22Z felipe $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -136,7 +136,7 @@ php_file_globals file_globals;
/* {{{ ZTS-stuff / Globals / Prototypes */
-/* sharing globals is *evil* */
+/* sharing globals is *evil* */
static int le_stream_context = FAILURE;
PHPAPI int php_le_stream_context(void)
@@ -2521,6 +2521,10 @@ PHP_FUNCTION(fnmatch)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Filename exceeds the maximum allowed length of %d characters", MAXPATHLEN);
RETURN_FALSE;
}
+ if (pattern_len >= MAXPATHLEN) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Pattern exceeds the maximum allowed length of %d characters", MAXPATHLEN);
+ RETURN_FALSE;
+ }
RETURN_BOOL( ! fnmatch( pattern, filename, flags ));
}