From: Stanislav Malyshev Date: Tue, 18 Sep 2007 20:19:34 +0000 (+0000) Subject: limit dl() argument length (patch by Christian Hoffmann) X-Git-Tag: php-5.2.5RC1~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=280e6464e892d03cb976f46982c9ffa2764a7769;p=php limit dl() argument length (patch by Christian Hoffmann) --- diff --git a/ext/standard/dl.c b/ext/standard/dl.c index 7b2f5df87f..a31f1b4b1b 100644 --- a/ext/standard/dl.c +++ b/ext/standard/dl.c @@ -73,6 +73,11 @@ PHP_FUNCTION(dl) 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)) {