From 0c7872f88a78c25989e28c91b7ac88613aaea283 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sat, 12 Sep 2015 21:37:12 +0200 Subject: [PATCH] add range check --- ext/dom/namednodemap.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/dom/namednodemap.c b/ext/dom/namednodemap.c index eb2fe25f01..d2e07ba7e8 100644 --- a/ext/dom/namednodemap.c +++ b/ext/dom/namednodemap.c @@ -214,6 +214,11 @@ PHP_FUNCTION(dom_namednodemap_item) return; } if (index >= 0) { + if (ZEND_LONG_INT_OVFL(index)) { + php_error_docref(NULL, E_WARNING, "Invalid index"); + RETURN_NULL(); + } + intern = Z_DOMOBJ_P(id); objmap = (dom_nnodemap_object *)intern->ptr; -- 2.40.0