]> granicus.if.org Git - php/commitdiff
Sanity check zpp max argument count
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 13 Oct 2020 15:53:49 +0000 (17:53 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 14 Oct 2020 08:06:55 +0000 (10:06 +0200)
This would have prevented 9b4094c.

Closes GH-6334.

Zend/zend_API.h

index 0b6808b6788369ddd05c59383e848418e5e5f635..301b0400041e56e5ceda69c2dd62348e34ddd22e 100644 (file)
@@ -1311,6 +1311,7 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
        } while (0)
 
 #define ZEND_PARSE_PARAMETERS_END_EX(failure) \
+                       ZEND_ASSERT(_i == _max_num_args || _max_num_args == (uint32_t) -1); \
                } while (0); \
                if (UNEXPECTED(_error_code != ZPP_ERROR_OK)) { \
                        if (!(_flags & ZEND_PARSE_PARAMS_QUIET)) { \