]> granicus.if.org Git - php/commitdiff
- MFZE1
authorDerick Rethans <derick@php.net>
Wed, 8 May 2002 14:10:30 +0000 (14:10 +0000)
committerDerick Rethans <derick@php.net>
Wed, 8 May 2002 14:10:30 +0000 (14:10 +0000)
Zend/zend_builtin_functions.c

index fc5bd14584e5d3ec667d70ac983db26a07e1cca7..23fce3ce43d9527b2801ef90279a434c751f93d5 100644 (file)
@@ -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;