From e1a2e88c16775a5617fd60d601726af11154a7ac Mon Sep 17 00:00:00 2001 From: Sriram Natarajan Date: Fri, 2 Oct 2009 00:13:53 +0000 Subject: [PATCH] - Fixed bug #49738 (calling mcrypt after mcrypt_generic_deinit crashes). --- ext/mcrypt/mcrypt.c | 1 + ext/mcrypt/tests/bug49738.phpt | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 ext/mcrypt/tests/bug49738.phpt diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 9a3234ace3..d64633f3f5 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -693,6 +693,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 -- 2.50.1