File: 119-CVE-2007-1583-MOPB-26.patch

package info (click to toggle)
php5 5.2.0%2Bdfsg-8%2Betch16
  • links: PTS
  • area: main
  • in suites: etch
  • size: 58,940 kB
  • ctags: 45,388
  • sloc: ansic: 533,605; sh: 17,835; php: 11,336; cpp: 4,289; xml: 3,809; yacc: 2,446; lex: 2,174; makefile: 1,150; tcl: 1,128; awk: 693; perl: 71; sql: 22; pascal: 15
file content (27 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Index: php5-5.2.0/ext/mbstring/mb_gpc.c
===================================================================
--- php5-5.2.0.orig/ext/mbstring/mb_gpc.c	2007-04-22 19:07:48.000000000 +0200
+++ php5-5.2.0/ext/mbstring/mb_gpc.c	2007-04-22 19:07:52.000000000 +0200
@@ -206,9 +206,8 @@
 	/* register_globals stuff
 	 * XXX: this feature is going to be deprecated? */
 
-	if (info->force_register_globals) {
-		prev_rg_state = PG(register_globals);
-		PG(register_globals) = 1;
+	if (info->force_register_globals && !(prev_rg_state = PG(register_globals))) {
+		zend_alter_ini_entry("register_globals", sizeof("register_globals"), "1", sizeof("1")-1, PHP_INI_PERDIR, PHP_INI_STAGE_RUNTIME);
 	}
 
 	if (!res || *res == '\0') {
@@ -341,8 +340,8 @@
 
 out:
 	/* register_global stuff */
-	if (info->force_register_globals) {
-		PG(register_globals) = prev_rg_state;
+	if (info->force_register_globals && !prev_rg_state) {
+		zend_alter_ini_entry("register_globals", sizeof("register_globals"), "0", sizeof("0")-1, PHP_INI_PERDIR, PHP_INI_STAGE_RUNTIME);
 	}
 
 	if (convd != NULL) {