[Pkg-php-commits] [php/debian-sid] Cherry pick fix for segfault when node is NULL in simplexml

Ondřej Surý ondrej at sury.org
Wed Jan 5 10:06:14 UTC 2011


---
 ...x-segfault-when-node-is-NULL-in-simplexml.patch |   11 +++++++++++
 debian/patches/series                              |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)
 create mode 100644 debian/patches/fix-segfault-when-node-is-NULL-in-simplexml.patch

diff --git a/debian/patches/fix-segfault-when-node-is-NULL-in-simplexml.patch b/debian/patches/fix-segfault-when-node-is-NULL-in-simplexml.patch
new file mode 100644
index 0000000..c21ae52
--- /dev/null
+++ b/debian/patches/fix-segfault-when-node-is-NULL-in-simplexml.patch
@@ -0,0 +1,11 @@
+--- a/ext/simplexml/simplexml.c
++++ b/ext/simplexml/simplexml.c
+@@ -1099,7 +1099,7 @@ static HashTable * sxe_get_prop_hash(zva
+ 		if (sxe->iter.type == SXE_ITER_ELEMENT) {
+ 			node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
+ 		}
+-		if (node->tpye != XML_ENTITY_DECL) {
++		if (!node || node->type != XML_ENTITY_DECL) {
+ 			attr = node ? (xmlAttrPtr)node->properties : NULL;
+ 			zattr = NULL;
+ 			test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST;
diff --git a/debian/patches/series b/debian/patches/series
index e29eab9..16271f9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -86,3 +86,4 @@ fix-leaks-and-crash-bug-when-passing-the-callback-as-variable.patch
 fix-memory-leak-inside-highlight_string.patch
 fix-segfault-in-pgsql_stmt_execute-when-postgres-is-down.patch
 fix-segfault-when-extending-SplFixedArray.patch
+fix-segfault-when-node-is-NULL-in-simplexml.patch
-- 
1.7.1





More information about the Pkg-php-commits mailing list