stas            Tue Sep 18 20:19:34 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       dl.c 
  Log:
  limit dl() argument length (patch by Christian Hoffmann)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/dl.c?r1=1.106.2.1.2.4&r2=1.106.2.1.2.5&diff_format=u
Index: php-src/ext/standard/dl.c
diff -u php-src/ext/standard/dl.c:1.106.2.1.2.4 
php-src/ext/standard/dl.c:1.106.2.1.2.5
--- php-src/ext/standard/dl.c:1.106.2.1.2.4     Thu Sep 13 07:42:12 2007
+++ php-src/ext/standard/dl.c   Tue Sep 18 20:19:34 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: dl.c,v 1.106.2.1.2.4 2007/09/13 07:42:12 jani Exp $ */
+/* $Id: dl.c,v 1.106.2.1.2.5 2007/09/18 20:19:34 stas Exp $ */
 
 #include "php.h"
 #include "dl.h"
@@ -73,6 +73,11 @@
                RETURN_FALSE;
        }
 
+       if (Z_STRLEN_PP(file) >= MAXPATHLEN) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "File name exceeds 
the maximum allowed length of %d characters", MAXPATHLEN);
+               RETURN_FALSE;
+       }
+
        if ((strncmp(sapi_module.name, "cgi", 3)!=0) && 
                (strcmp(sapi_module.name, "cli")!=0) &&
                (strncmp(sapi_module.name, "embed", 5)!=0)) {

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

Reply via email to