mirror of
https://github.com/php/php-src.git
synced 2025-01-22 19:54:13 +08:00
Added missing safety checks (Problem identified by Coverity scan)
This commit is contained in:
parent
34ed116e90
commit
12f7021e12
@ -1355,7 +1355,9 @@ PHP_METHOD(domdocument, __construct)
|
||||
}
|
||||
}
|
||||
intern->document = NULL;
|
||||
php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC);
|
||||
if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, docp TSRMLS_CC) == -1) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
php_libxml_increment_node_ptr((php_libxml_node_object *)intern, (xmlNodePtr)docp, (void *)intern TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
@ -1568,7 +1570,9 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode) {
|
||||
}
|
||||
}
|
||||
intern->document = NULL;
|
||||
php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC);
|
||||
if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
intern->document->doc_props = doc_prop;
|
||||
}
|
||||
|
||||
@ -2069,7 +2073,9 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode)
|
||||
}
|
||||
}
|
||||
intern->document = NULL;
|
||||
php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC);
|
||||
if (php_libxml_increment_doc_ref((php_libxml_node_object *)intern, newdoc TSRMLS_CC) == -1) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
intern->document->doc_props = doc_prop;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user