]> granicus.if.org Git - php/commitdiff
MFB: docs say dl() parameter can be filename only - enforce it
authorStanislav Malyshev <stas@php.net>
Thu, 13 Sep 2007 01:16:24 +0000 (01:16 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 13 Sep 2007 01:16:24 +0000 (01:16 +0000)
ext/standard/dl.c

index aecdf24ee631a28d67d8be03ad4b8c3721667927..4695a42dca043744a23c425f2807954cfd00f562 100644 (file)
@@ -115,6 +115,13 @@ void php_dl(zval *file, int type, zval *return_value, int start_now TSRMLS_DC)
        if (extension_dir && extension_dir[0]){
                int extension_dir_len = strlen(extension_dir);
 
+               if(type == MODULE_TEMPORARY) {
+                       if(strchr(filename, '/') != NULL || strchr(filename, DEFAULT_SLASH) != NULL) {
+                               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Temporary module name should contain only filename");
+                               RETURN_FALSE;
+                       }
+               }
+
                if (IS_SLASH(extension_dir[extension_dir_len-1])) {
                        spprintf(&libpath, 0, "%s%s", extension_dir, filename); /* SAFE */
                } else {