]> granicus.if.org Git - php/commitdiff
add range check
authorAnatol Belski <ab@php.net>
Sat, 12 Sep 2015 19:37:12 +0000 (21:37 +0200)
committerAnatol Belski <ab@php.net>
Wed, 16 Sep 2015 13:39:21 +0000 (15:39 +0200)
ext/dom/namednodemap.c

index eb2fe25f01adc879013ba9d64746c21221f152eb..d2e07ba7e8999865187539b7899f174e53b133bd 100644 (file)
@@ -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;