Skip to content

Commit 969dcf7

Browse files
committed
add overflow check
1 parent 5d035b5 commit 969dcf7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/dom/document.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,9 +1728,14 @@ PHP_FUNCTION(dom_document_xinclude)
17281728
return;
17291729
}
17301730

1731+
if (ZEND_LONG_EXCEEDS_INT(flags)) {
1732+
php_error_docref(NULL, E_WARNING, "Invalid flags");
1733+
RETURN_FALSE;
1734+
}
1735+
17311736
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
17321737

1733-
err = xmlXIncludeProcessFlags(docp, flags);
1738+
err = xmlXIncludeProcessFlags(docp, (int)flags);
17341739

17351740
/* XML_XINCLUDE_START and XML_XINCLUDE_END nodes need to be removed as these
17361741
are added via xmlXIncludeProcess to mark beginning and ending of xincluded document

0 commit comments

Comments
 (0)