com php-src: add overflow check: ext/dom/document.c
| From: | Anatol Belski | Date: | Sat, 12 Sep 2015 16:57:23 +0000 |
| Subject: | com php-src: add overflow check: ext/dom/document.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89007@lists.php.net to get a copy of this message | ||
Commit: 969dcf7b61b1570a8dec1c41e9b967643bb19085
Author: Anatol Belski <ab@php.net> Sat, 12 Sep 2015 18:57:23 +0200
Parents: 5d035b57ee68a5b3305b51ff9e6329411b3e5774
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=969dcf7b61b1570a8dec1c41e9b967643bb19085
Log:
add overflow check
Changed paths:
M ext/dom/document.c
Diff:
diff --git a/ext/dom/document.c b/ext/dom/document.c
index 5526e30..443fe48 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