Search
j0ke.net Open Build Service
>
Projects
>
internetx
:
php5
>
php-5.2.17
> php-5.2.14-CVE-2012-0831.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File php-5.2.14-CVE-2012-0831.patch of Package php-5.2.17 (Revision 19)
Currently displaying revision
19
,
show latest
http://svn.php.net/viewvc?view=revision&revision=323016 Index: main/php_variables.c =================================================================== --- main/php_variables.c.orig +++ main/php_variables.c @@ -448,7 +449,10 @@ void _php_import_environment_variables(z /* turn off magic_quotes while importing environment variables */ int magic_quotes_gpc = PG(magic_quotes_gpc); - PG(magic_quotes_gpc) = 0; + + if (PG(magic_quotes_gpc)) { + zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC); + } for (env = environ; env != NULL && *env != NULL; env++) { p = strchr(*env, '='); @@ -591,7 +595,9 @@ static inline void php_register_server_v zval_ptr_dtor(&PG(http_globals)[TRACK_VARS_SERVER]); } PG(http_globals)[TRACK_VARS_SERVER] = array_ptr; - PG(magic_quotes_gpc) = 0; + if (PG(magic_quotes_gpc)) { + zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC); + } /* Server variables */ if (sapi_module.register_server_variables) { Index: sapi/cgi/cgi_main.c =================================================================== --- sapi/cgi/cgi_main.c.orig +++ sapi/cgi/cgi_main.c @@ -77,6 +77,7 @@ int __riscosify_control = __RISCOSIFY_ST #include "zend_execute.h" #include "zend_highlight.h" #include "zend_indent.h" +#include "zend_ini.h" #include "php_getopt.h" @@ -609,7 +610,9 @@ void cgi_php_import_environment_variable int filter_arg = (array_ptr == PG(http_globals)[TRACK_VARS_ENV])?PARSE_ENV:PARSE_SERVER; /* turn off magic_quotes while importing environment variables */ - PG(magic_quotes_gpc) = 0; + if (PG(magic_quotes_gpc)) { + zend_alter_ini_entry_ex("magic_quotes_gpc", sizeof("magic_quotes_gpc"), "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_ACTIVATE, 1 TSRMLS_CC); + } for (zend_hash_internal_pointer_reset_ex(&request->env, &pos); zend_hash_get_current_key_ex(&request->env, &var, &var_len, &idx, 0, &pos) == HASH_KEY_IS_STRING && zend_hash_get_current_data_ex(&request->env, (void **) &val, &pos) == SUCCESS;