From: Sriram Natarajan Date: Fri, 2 Oct 2009 00:13:53 +0000 (+0000) Subject: - Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes). X-Git-Tag: php-5.2.12RC1~88 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0de483dcf4e4f5de5046e55c877f709ca8ee03f8;p=php - Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes). --- diff --git a/NEWS b/NEWS index ed5d5dabe4..50cc72f7f9 100644 --- a/NEWS +++ b/NEWS @@ -20,6 +20,8 @@ - Fixed bug #49528 (UTF-16 strings prefixed by BOMs wrongly converted). (Moriyoshi) - Fixed bug #48805 (IPv6 socket transport is not working). (Ilia) +- Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes). + (Sriram Natarajan) 17 Sep 2009, PHP 5.2.11 - Fixed certificate validation inside php_openssl_apply_verification_policy. diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 253c6967b4..d21318d9e1 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -613,6 +613,7 @@ PHP_FUNCTION(mcrypt_generic_deinit) php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not terminate encryption specifier"); RETURN_FALSE } + pm->init = 0; RETURN_TRUE } /* }}} */ diff --git a/ext/mcrypt/tests/bug49738.phpt b/ext/mcrypt/tests/bug49738.phpt new file mode 100644 index 0000000000..8f01bec496 --- /dev/null +++ b/ext/mcrypt/tests/bug49738.phpt @@ -0,0 +1,13 @@ +--TEST-- +Bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Warning: mcrypt_generic(): Operation disallowed prior to mcrypt_generic_init(). in %sbug49738.php on line 5