Derick Rethans wrote:
> derick                Tue May  1 16:07:37 2007 UTC

> http://cvs.php.net/viewvc.cgi/php-src/ext/mcrypt/mcrypt.c?r1=1.77.4.7.4.2&r2=1.77.4.7.4.3&diff_format=u
> Index: php-src/ext/mcrypt/mcrypt.c
> diff -u php-src/ext/mcrypt/mcrypt.c:1.77.4.7.4.2 
> php-src/ext/mcrypt/mcrypt.c:1.77.4.7.4.3
> --- php-src/ext/mcrypt/mcrypt.c:1.77.4.7.4.2  Mon Jan  1 09:46:44 2007
> +++ php-src/ext/mcrypt/mcrypt.c       Tue May  1 16:07:37 2007
> @@ -16,7 +16,7 @@
>     |          Derick Rethans <[EMAIL PROTECTED]>                    |
>     +----------------------------------------------------------------------+
>   */
> -/* $Id: mcrypt.c,v 1.77.4.7.4.2 2007/01/01 09:46:44 sebastian Exp $ */
> +/* $Id: mcrypt.c,v 1.77.4.7.4.3 2007/05/01 16:07:37 derick Exp $ */
>  
>  #ifdef HAVE_CONFIG_H
>  #include "config.h"
> @@ -38,6 +38,10 @@
>  
>  static int le_mcrypt;
>  
> +typedef struct _php_mcrypt { 
> +     MCRYPT td;
> +     zend_bool init;
> +} php_mcrypt;
>  
>  function_entry mcrypt_functions[] = {
>       PHP_FE(mcrypt_ecb, NULL)
> @@ -208,10 +212,12 @@
>       }
>  
>  #define MCRYPT_GET_TD_ARG                                                    
>                         \
> +     zval **mcryptind;                                                       
>                                 \
> +     php_mcrypt *pm;                                                         
>                                         \
>       if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &mcryptind) == 
> FAILURE) {                 \
>               WRONG_PARAM_COUNT                                               
>                                                                               
>           \
>       }                                                                       
>                                                                               
>                           \
> -     ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", le_mcrypt);   
>                         
> +     ZEND_FETCH_RESOURCE (pm, php_mcrypt *, mcryptind, -1, "MCrypt", 
> le_mcrypt);                             
>  
>  #define MCRYPT_GET_MODE_DIR_ARGS(DIRECTORY)                                  
>                         \
>       char *dir = NULL;                                                   \
> @@ -240,6 +246,12 @@
>  #define MCRYPT_ENTRY2_4(a) MCRYPT_ENTRY_NAMED(a, a)
>  #endif
>  
> +#define PHP_MCRYPT_INIT_CHECK        \
> +     if (!pm->init) {        \
> +             php_error_docref(NULL TSRMLS_CC, E_WARNING, "Operation 
> disallowed prior to mcrypt_generic_init().");    \
> +             RETURN_FALSE;   \
> +     }       \
> +

Please don't add error messages with periods!

Thanks,
-- 
Michael

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to