From: Hannes Magnusson Date: Tue, 3 Oct 2006 16:37:51 +0000 (+0000) Subject: MFH: compact() doesnt throw "wrong param count" X-Git-Tag: php-5.2.0RC5~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59fabbb464e799c0aa88e87b3f82b2d7ad96928c;p=php MFH: compact() doesnt throw "wrong param count" --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 9d986137d1..13a6ff2c9c 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1507,6 +1507,9 @@ PHP_FUNCTION(compact) zval ***args; /* function arguments array */ int i; + if (ZEND_NUM_ARGS() < 1) { + WRONG_PARAM_COUNT; + } args = (zval ***)safe_emalloc(ZEND_NUM_ARGS(), sizeof(zval **), 0); if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {