tony2001                Wed Sep 10 07:31:12 2008 UTC

  Modified files:              
    /php-src/ext/mcrypt mcrypt.c 
  Log:
  check for NULL before freeing
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mcrypt/mcrypt.c?r1=1.115&r2=1.116&diff_format=u
Index: php-src/ext/mcrypt/mcrypt.c
diff -u php-src/ext/mcrypt/mcrypt.c:1.115 php-src/ext/mcrypt/mcrypt.c:1.116
--- php-src/ext/mcrypt/mcrypt.c:1.115   Sun Sep  7 22:53:20 2008
+++ php-src/ext/mcrypt/mcrypt.c Wed Sep 10 07:31:12 2008
@@ -16,7 +16,7 @@
    |          Derick Rethans <[EMAIL PROTECTED]>                    |
    +----------------------------------------------------------------------+
  */
-/* $Id: mcrypt.c,v 1.115 2008/09/07 22:53:20 felipe Exp $ */
+/* $Id: mcrypt.c,v 1.116 2008/09/10 07:31:12 tony2001 Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -1275,7 +1275,7 @@
 int php_mcrypt_func(php_mcrypt_op op, char *cipher, char *mode, char *key_str, 
int key_len, char *iv_str, int iv_len, char *data_str, int data_len, char 
**data_copy, int *data_size TSRMLS_DC)
 {
        MCRYPT td;
-       char *cipher_dir_string, *module_dir_string, *key_copy, *iv_copy;
+       char *cipher_dir_string, *module_dir_string, *key_copy, *iv_copy = NULL;
        int i, status = SUCCESS, count, *key_sizes, key_size, iv_size, 
block_size;
        
        MCRYPT_GET_INI
@@ -1362,7 +1362,9 @@
        }
        
        efree(key_copy);
-       efree(iv_copy);
+       if (iv_copy) {
+               efree(iv_copy);
+       }
        
        return status;
 }



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

Reply via email to