diff options
author | Florian Smeets <flo@FreeBSD.org> | 2015-02-24 22:36:49 +0000 |
---|---|---|
committer | Florian Smeets <flo@FreeBSD.org> | 2015-02-24 22:36:49 +0000 |
commit | a3487b0b0959f97b6226d927aec54ac1599a950b (patch) | |
tree | 9610e048866efffff97a4a5be14c3200b7207c75 /lang/php53/files/patch-CVE-2014-8142.patch | |
parent | net/syncthing: fix WRKSRC (diff) |
Add patches for
- CVE-2014-8142
- CVE-2015-0231
MFH: 2015Q1
Notes
Notes:
svn path=/head/; revision=379853
Diffstat (limited to 'lang/php53/files/patch-CVE-2014-8142.patch')
-rw-r--r-- | lang/php53/files/patch-CVE-2014-8142.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/lang/php53/files/patch-CVE-2014-8142.patch b/lang/php53/files/patch-CVE-2014-8142.patch new file mode 100644 index 000000000000..f023909d9024 --- /dev/null +++ b/lang/php53/files/patch-CVE-2014-8142.patch @@ -0,0 +1,56 @@ +Index: ext/standard/tests/serialize/bug68594.phpt +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ ext/standard/tests/serialize/bug68594.phpt 2015-02-13 11:27:34.753347966 -0500 +@@ -0,0 +1,23 @@ ++--TEST-- ++Bug #68545 Use after free vulnerability in unserialize() ++--FILE-- ++<?php ++for ($i=4; $i<100; $i++) { ++ $m = new StdClass(); ++ ++ $u = array(1); ++ ++ $m->aaa = array(1,2,&$u,4,5); ++ $m->bbb = 1; ++ $m->ccc = &$u; ++ $m->ddd = str_repeat("A", $i); ++ ++ $z = serialize($m); ++ $z = str_replace("bbb", "aaa", $z); ++ $y = unserialize($z); ++ $z = serialize($y); ++} ++?> ++===DONE=== ++--EXPECTF-- ++===DONE=== +Index: ext/standard/var_unserializer.c +=================================================================== +--- ext/standard/var_unserializer.c 2015-02-13 11:27:34.793348294 -0500 ++++ ext/standard/var_unserializer.c 2015-02-13 11:27:34.753347966 -0500 +@@ -298,6 +298,9 @@ + } else { + /* object properties should include no integers */ + convert_to_string(key); ++ if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { ++ var_push_dtor(var_hash, old_data); ++ } + zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, + sizeof data, NULL); + } +Index: ext/standard/var_unserializer.re +=================================================================== +--- ext/standard/var_unserializer.re 2015-02-13 11:27:34.793348294 -0500 ++++ ext/standard/var_unserializer.re 2015-02-13 11:27:34.753347966 -0500 +@@ -304,6 +304,9 @@ + } else { + /* object properties should include no integers */ + convert_to_string(key); ++ if (zend_symtable_find(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, (void **)&old_data)==SUCCESS) { ++ var_push_dtor(var_hash, old_data); ++ } + zend_hash_update(ht, Z_STRVAL_P(key), Z_STRLEN_P(key) + 1, &data, + sizeof data, NULL); + } |