Advertisement
laruence

Untitled

Jan 4th, 2012
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.30 KB | None | 0 0
  1. Index: main/php_variables.c
  2. ===================================================================
  3. --- main/php_variables.c    (revision 321752)
  4. +++ main/php_variables.c    (working copy)
  5. @@ -179,14 +179,9 @@
  6.                 escaped_index = index;
  7.                 if (zend_symtable_find(symtable1, escaped_index, index_len + 1, (void **) &gpc_element_p) == FAILURE
  8.                     || Z_TYPE_PP(gpc_element_p) != IS_ARRAY) {
  9. -                   if (zend_hash_num_elements(symtable1) <= PG(max_input_vars)) {
  10. -                       if (zend_hash_num_elements(symtable1) == PG(max_input_vars)) {
  11. -                           php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
  12. -                       }
  13. -                       MAKE_STD_ZVAL(gpc_element);
  14. -                       array_init(gpc_element);
  15. -                       zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
  16. -                   }
  17. +                   MAKE_STD_ZVAL(gpc_element);
  18. +                   array_init(gpc_element);
  19. +                   zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
  20.                 }
  21.                 if (index != escaped_index) {
  22.                     efree(escaped_index);
  23. @@ -225,14 +220,7 @@
  24.                 zend_symtable_exists(symtable1, escaped_index, index_len + 1)) {
  25.                 zval_ptr_dtor(&gpc_element);
  26.             } else {
  27. -               if (zend_hash_num_elements(symtable1) <= PG(max_input_vars)) {
  28. -                   if (zend_hash_num_elements(symtable1) == PG(max_input_vars)) {
  29. -                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
  30. -                   }
  31. -                   zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
  32. -               } else {
  33. -                   zval_ptr_dtor(&gpc_element);
  34. -               }
  35. +               zend_symtable_update(symtable1, escaped_index, index_len + 1, &gpc_element, sizeof(zval *), (void **) &gpc_element_p);
  36.             }
  37.             if (escaped_index != index) {
  38.                 efree(escaped_index);
  39. @@ -271,6 +259,10 @@
  40.             efree(val);
  41.         }
  42.         s = p + 1;
  43. +       if (zend_hash_num_elements(Z_ARRVAL_P(array_ptr)) >= PG(max_input_vars)) {
  44. +           php_error_docref(NULL TSRMLS_CC, E_WARNING, "Input variables exceeded %ld. To increase the limit change max_input_vars in php.ini.", PG(max_input_vars));
  45. +           return;
  46. +       }
  47.     }
  48.     if (s < e) {
  49.         p = e;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement