diff options
author | Anatol Belski <ab@php.net> | 2015-09-12 18:57:23 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2015-09-12 18:57:23 +0200 |
commit | 969dcf7b61b1570a8dec1c41e9b967643bb19085 (patch) | |
tree | 98efcaea920693c37da19b03290f211b00935c5c | |
parent | 5d035b57ee68a5b3305b51ff9e6329411b3e5774 (diff) | |
download | php-git-969dcf7b61b1570a8dec1c41e9b967643bb19085.tar.gz |
add overflow check
-rw-r--r-- | ext/dom/document.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/dom/document.c b/ext/dom/document.c index 5526e30f66..443fe4850d 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -1728,9 +1728,14 @@ PHP_FUNCTION(dom_document_xinclude) return; } + if (ZEND_LONG_EXCEEDS_INT(flags)) { + php_error_docref(NULL, E_WARNING, "Invalid flags"); + RETURN_FALSE; + } + DOM_GET_OBJ(docp, id, xmlDocPtr, intern); - err = xmlXIncludeProcessFlags(docp, flags); + err = xmlXIncludeProcessFlags(docp, (int)flags); /* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these are added via xmlXIncludeProcess to mark beginning and ending of xincluded document |