diff options
author | Uwe Steinmann <steinm@php.net> | 2001-01-05 14:11:19 +0000 |
---|---|---|
committer | Uwe Steinmann <steinm@php.net> | 2001-01-05 14:11:19 +0000 |
commit | db56ddb36c240c7b69a543bf8891c23d22b3a895 (patch) | |
tree | 0599b72b7376a0e9592d77196ccefdd521a69f9d /ext/domxml/php_domxml.c | |
parent | 3cb57374a8ffada8b4d801c59215bdbd96490d64 (diff) | |
download | php-git-db56ddb36c240c7b69a543bf8891c23d22b3a895.tar.gz |
- fixed potential segmfault in xmldoc() and xmldocfile()
Diffstat (limited to 'ext/domxml/php_domxml.c')
-rw-r--r-- | ext/domxml/php_domxml.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/domxml/php_domxml.c b/ext/domxml/php_domxml.c index ab2a0359e7..8bfbccc337 100644 --- a/ext/domxml/php_domxml.c +++ b/ext/domxml/php_domxml.c @@ -1062,7 +1062,7 @@ PHP_FUNCTION(xmldoc) if(docp->name) add_property_stringl(return_value, "name", (char *) docp->name, strlen(docp->name), 1); if(docp->URL) - add_property_stringl(return_value, "url", (char *) docp->name, strlen(docp->name), 1); + add_property_stringl(return_value, "url", (char *) docp->URL, strlen(docp->URL), 1); add_property_stringl(return_value, "version", (char *) docp->version, strlen(docp->version), 1); if(docp->encoding) add_property_stringl(return_value, "encoding", (char *) docp->encoding, strlen(docp->encoding), 1); @@ -1096,10 +1096,17 @@ PHP_FUNCTION(xmldocfile) /* construct an object with some methods */ object_init_ex(return_value, domxmldoc_class_entry_ptr); add_property_resource(return_value, "doc", ret); + if(docp->name) + add_property_stringl(return_value, "name", (char *) docp->name, strlen(docp->name), 1); + if(docp->URL) + add_property_stringl(return_value, "url", (char *) docp->URL, strlen(docp->URL), 1); add_property_stringl(return_value, "version", (char *) docp->version, strlen(docp->version), 1); if(docp->encoding) add_property_stringl(return_value, "encoding", (char *) docp->encoding, strlen(docp->encoding), 1); add_property_long(return_value, "standalone", docp->standalone); + add_property_long(return_value, "type", docp->type); + add_property_long(return_value, "compression", docp->compression); + add_property_long(return_value, "charset", docp->charset); zend_list_addref(ret); } /* }}} */ @@ -1386,7 +1393,8 @@ static int node_children(zval **children, xmlNode *nodep) zval *child; xmlChar *content; int ret; - + +// if(last->type != XML_TEXT_NODE) { /* Each child is a node object */ MAKE_STD_ZVAL(child); ret = zend_list_insert(last, le_domxmlnodep); @@ -1419,8 +1427,9 @@ static int node_children(zval **children, xmlNode *nodep) if(0 <= node_children(&mchildren, last->children)) zend_hash_update(child->value.obj.properties, "children", sizeof("children"), (void *) &mchildren, sizeof(zval *), NULL); - last = last->next; count++; +// } + last = last->next; } return count; } |