mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix GH-16316: DOMXPath breaks when not initialized properly
Closes GH-16330.
This commit is contained in:
parent
509fec8ee6
commit
1d0fbdf449
3 changed files with 41 additions and 0 deletions
|
@ -264,6 +264,11 @@ int dom_xpath_document_read(dom_object *obj, zval *retval)
|
|||
docp = (xmlDocPtr) ctx->doc;
|
||||
}
|
||||
|
||||
if (UNEXPECTED(!docp)) {
|
||||
php_dom_throw_error(INVALID_STATE_ERR, /* strict */ true);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
php_dom_create_object((xmlNodePtr) docp, retval, obj);
|
||||
return SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue