File: CVE-2011-4153.patch

package info (click to toggle)
php5 5.3.3-7%2Bsqueeze19
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 122,836 kB
  • ctags: 55,742
  • sloc: ansic: 633,963; php: 19,620; sh: 11,344; xml: 5,816; cpp: 2,400; yacc: 1,745; exp: 1,514; makefile: 1,019; pascal: 623; awk: 537; sql: 22
file content (49 lines) | stat: -rw-r--r-- 1,527 bytes parent folder | download | duplicates (3)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--- a/ext/standard/syslog.c
+++ b/ext/standard/syslog.c
@@ -236,6 +236,9 @@ PHP_FUNCTION(openlog)
 		free(BG(syslog_device));
 	}
 	BG(syslog_device) = zend_strndup(ident, ident_len);
+	if(BG(syslog_device) == NULL) {
+		RETURN_FALSE;
+	}
 	openlog(BG(syslog_device), option, facility);
 	RETURN_TRUE;
 }
--- a/ext/com_dotnet/com_typeinfo.c
+++ b/ext/com_dotnet/com_typeinfo.c
@@ -187,6 +187,10 @@ PHPAPI int php_com_import_typelib(ITypeL
 				const_name = php_com_olestring_to_string(bstr_ids, &c.name_len, codepage TSRMLS_CC);
 				c.name = zend_strndup(const_name, c.name_len);
 				efree(const_name);
+				if(c.name == NULL) {
+					ITypeInfo_ReleaseVarDesc(TypeInfo, pVarDesc);
+					continue;
+				}
 				c.name_len++; /* include NUL */
 				SysFreeString(bstr_ids);
 
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1998,6 +1998,9 @@ php_oci_connection *php_oci_do_connect_e
 		} else {
 			connection = (php_oci_connection *) calloc(1, sizeof(php_oci_connection));
 			connection->hash_key = zend_strndup(hashed_details.c, hashed_details.len);
+			if(connection->hash_key == NULL) {
+				return NULL;
+			}
 			connection->is_persistent = 1;
 		}
 	} else {
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -683,6 +683,9 @@ repeat:
 	}
 	c.flags = case_sensitive; /* non persistent */
 	c.name = zend_strndup(name, name_len);
+	if(c.name == NULL) {
+		RETURN_FALSE;
+	}
 	c.name_len = name_len+1;
 	c.module_number = PHP_USER_CONSTANT;
 	if (zend_register_constant(&c TSRMLS_CC) == SUCCESS) {