mirror of
https://github.com/php/php-src.git
synced 2024-12-04 23:34:25 +08:00
fix a bunch of memory overruns, and uninitialized variable uses
fixes crash on sample script rob sent me
This commit is contained in:
parent
3ebf297261
commit
ee5f79487e
@ -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();
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user