derick          Mon Dec 16 04:03:12 2002 EDT

  Added files:                 (Branch: PHP_4_3)
    /php4/ext/mcrypt/tests      bug21039.phpt 

  Modified files:              
    /php4/ext/mcrypt    mcrypt.c 
  Log:
  - Fix bug #21039
  #- This is somewhat of a hack, and thus I will not merge it to HEAD, as
  #  I've lots of other commits waiting for that. 
  
  
Index: php4/ext/mcrypt/mcrypt.c
diff -u php4/ext/mcrypt/mcrypt.c:1.77.4.1 php4/ext/mcrypt/mcrypt.c:1.77.4.2
--- php4/ext/mcrypt/mcrypt.c:1.77.4.1   Fri Nov 29 10:57:39 2002
+++ php4/ext/mcrypt/mcrypt.c    Mon Dec 16 04:03:09 2002
@@ -16,7 +16,7 @@
    |          Derick Rethans <[EMAIL PROTECTED]>                      |
    +----------------------------------------------------------------------+
  */
-/* $Id: mcrypt.c,v 1.77.4.1 2002/11/29 15:57:39 derick Exp $ */
+/* $Id: mcrypt.c,v 1.77.4.2 2002/12/16 09:03:09 derick Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -182,6 +182,13 @@
                WRONG_PARAM_COUNT;                                                     
                         \
        }
 
+#define MCRYPT_CHECK_PARAM_COUNT_EX(a,b)                                              
+ \
+       if (argc < (a) || argc > (b)) {                                                
+         \
+               zend_get_parameters_ex(1, &mcryptind);                                 
+ \
+               zend_list_delete (Z_LVAL_PP(mcryptind));                \
+               WRONG_PARAM_COUNT;                                                     
+                         \
+       }
+
 #define MCRYPT_GET_CRYPT_ARGS                                                         
         \
        switch (argc) {                                                                
                         \
                case 5:                                                                
                                 \
@@ -455,7 +462,7 @@
        int result = 0;
        
        argc = ZEND_NUM_ARGS();
-       MCRYPT_CHECK_PARAM_COUNT (3,3)
+       MCRYPT_CHECK_PARAM_COUNT_EX (3,3)
        
        zend_get_parameters_ex(3, &mcryptind, &key, &iv);
        ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt);          
                 
@@ -530,7 +537,7 @@
        int block_size, data_size;
        
        argc = ZEND_NUM_ARGS();
-       MCRYPT_CHECK_PARAM_COUNT (2,2)
+       MCRYPT_CHECK_PARAM_COUNT_EX (2,2)
        
        zend_get_parameters_ex(2, &mcryptind, &data);
        ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt);
@@ -571,7 +578,7 @@
        int block_size, data_size;
        
        argc = ZEND_NUM_ARGS();
-       MCRYPT_CHECK_PARAM_COUNT (2,2)
+       MCRYPT_CHECK_PARAM_COUNT_EX (2,2)
        
        zend_get_parameters_ex(2, &mcryptind, &data);
        ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt);          
                 

Index: php4/ext/mcrypt/tests/bug21039.phpt
+++ php4/ext/mcrypt/tests/bug21039.phpt



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to