File: 147-CVE-2009-0754.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,339 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
#
# Description: fix mbstring.func_overload setting in .htaccess affects
#              other virtual hosts.
# Patch: http://cvsweb.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.276&r2=1.277
# Upstream: http://bugs.php.net/bug.php?id=27421
#
diff -Nur php5-5.2.4/ext/mbstring/mbstring.c php5-5.2.4.new/ext/mbstring/mbstring.c
--- php5-5.2.4/ext/mbstring/mbstring.c	2007-07-12 11:31:54.000000000 -0400
+++ php5-5.2.4.new/ext/mbstring/mbstring.c	2009-04-15 13:31:19.000000000 -0400
@@ -1020,9 +1020,14 @@
  	/*  clear overloaded function. */
 	if (MBSTRG(func_overload)){
 		p = &(mb_ovld[0]);
-		while (p->type > 0 && zend_hash_find(EG(function_table), p->save_func, strlen(p->save_func)+1 , (void **)&orig) == SUCCESS) {
-			zend_hash_update(EG(function_table), p->orig_func, strlen(p->orig_func)+1, orig, sizeof(zend_function), NULL);
-			zend_hash_del(EG(function_table), p->save_func, strlen(p->save_func)+1);
+		while (p->type > 0) {
+			if ((MBSTRG(func_overload) & p->type) == p->type && 
+				zend_hash_find(EG(function_table), p->save_func,
+					strlen(p->save_func)+1, (void **)&orig) == SUCCESS) {
+
+				zend_hash_update(EG(function_table), p->orig_func, strlen(p->orig_func)+1, orig, sizeof(zend_function), NULL);
+				zend_hash_del(EG(function_table), p->save_func, strlen(p->save_func)+1);
+			}
 			p++;
 		}
 	}