fix a bunch of memory overruns, and uninitialized variable uses

fixes crash on sample script rob sent me
This commit is contained in:
Sterling Hughes 2003-06-05 18:54:25 +00:00
parent 3ebf297261
commit ee5f79487e
3 changed files with 7 additions and 1 deletions

View File

@ -65,7 +65,7 @@ PHP_FUNCTION(dom_element_element)
xmlNodePtr nodep = NULL, oldnode = NULL;
dom_object *intern;
char *name, *value = NULL;
int name_len, value_len;
int name_len, value_len = 0;
id = getThis();

View File

@ -982,6 +982,10 @@ PHP_FUNCTION(dom_node_append_child)
return;
}
if (!PZVAL_IS_REF(node)) {
zval_add_ref(&node);
}
DOM_GET_OBJ(child, node, xmlNodePtr);
if (dom_hierarchy(nodep, child) == FAILURE) {

View File

@ -698,9 +698,11 @@ void node_free_resource(xmlNodePtr node TSRMLS_DC)
{
xmlDtdPtr extSubset, intSubset;
xmlDocPtr docp;
if (!node) {
return;
}
switch (node->type) {
case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE: