]> granicus.if.org Git - php/commitdiff
add overflow check
authorAnatol Belski <ab@php.net>
Sat, 12 Sep 2015 16:57:23 +0000 (18:57 +0200)
committerAnatol Belski <ab@php.net>
Sat, 12 Sep 2015 16:57:23 +0000 (18:57 +0200)
ext/dom/document.c

index 5526e30f66bbf76c5d8077c9006200db9bfad367..443fe4850d846dc0d4dd02d3f95b2ebcccdf27df 100644 (file)
@@ -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