From: Derick Rethans Date: Wed, 8 May 2002 14:10:30 +0000 (+0000) Subject: - MFZE1 X-Git-Tag: php-4.3.0dev-ZendEngine2-Preview1~190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b43ba8dfe26d3ec7144622c9bb7ffab46742768f;p=php - MFZE1 --- diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index fc5bd14584..23fce3ce43 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -180,6 +180,11 @@ ZEND_FUNCTION(func_get_arg) convert_to_long_ex(z_requested_offset); requested_offset = (*z_requested_offset)->value.lval; + if (requested_offset < 0) { + zend_error(E_WARNING, "func_get_arg(): The argument number should be >= 0"); + RETURN_FALSE; + } + p = EG(argument_stack).top_element-1-1; arg_count = (ulong) *p; /* this is the amount of arguments passed to func_get_arg(); */ p -= 1+arg_count;