svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/openssl/openssl.c branches/PHP_5_3/ext/openssl/tests/bug54060.phpt
trunk/ext/openssl/openssl.c trunk/ext/openssl/tests/bug54060.phpt
| From: | Pierre Joye | Date: | Mon, 21 Feb 2011 10:07:31 +0000 |
| Subject: | svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/openssl/openssl.c branches/PHP_5_3/ext/openssl/tests/bug54060.phpt trunk/ext/openssl/openssl.c trunk/ext/openssl/tests/bug54060.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-64582@lists.php.net to get a copy of this message | ||
pajoye Mon, 21 Feb 2011 10:07:31 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=308531
Log:
- fix bug #54060, memory leak in openssl_encrypt
Bug: http://bugs.php.net/54060 (Open) Memory leaks when
openssl_encrypt called
Changed paths:
U php/php-src/branches/PHP_5_3/NEWS
U php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
A php/php-src/branches/PHP_5_3/ext/openssl/tests/bug54060.phpt
U php/php-src/trunk/ext/openssl/openssl.c
A php/php-src/trunk/ext/openssl/tests/bug54060.phpt
Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS 2011-02-21 08:12:33 UTC (rev 308530)
+++ php/php-src/branches/PHP_5_3/NEWS 2011-02-21 10:07:31 UTC (rev 308531)
@@ -8,6 +8,8 @@
- Exif extension:
. Fixed bug #54002 (crash on crafted tag, reported by Luca Carettoni). (Pierre)
(CVE-2011-0708)
+- OpenSSL extension:
+ . Fixed bug #54060 (Memory leaks when openssl_encrypt). (Pierre)
- SPL extension:
. Fixed memory leak in DirectoryIterator::getExtension() and
Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2011-02-21 08:12:33 UTC (rev 308530)
+++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2011-02-21 10:07:31 UTC (rev 308531)
@@ -4731,6 +4731,7 @@
if (free_iv) {
efree(iv);
}
+ EVP_CIPHER_CTX_cleanup(&cipher_ctx);
}
/* }}} */
Added: php/php-src/branches/PHP_5_3/ext/openssl/tests/bug54060.phpt
===================================================================
--- php/php-src/branches/PHP_5_3/ext/openssl/tests/bug54060.phpt (rev 0)
+++ php/php-src/branches/PHP_5_3/ext/openssl/tests/bug54060.phpt 2011-02-21 10:07:31 UTC (rev
308531)
@@ -0,0 +1,17 @@
+--TEST--
+Bug #54060 (Memory leak in openssl_encrypt)
+--SKIPIF--
+<?php if (!extension_loaded("openssl")) die("skip"); ?>
+--FILE--
+<?php
+
+$data = "jfdslkjvflsdkjvlkfjvlkjfvlkdm,4w 043920r 9234r 32904r 09243
+r7-89437 r892374 r894372 r894 7289r7 f frwerfh i iurf iuryw uyrfouiwy ruy
+972439 8478942 yrhfjkdhls";
+$pass = "r23498rui324hjbnkj";
+
+openssl_encrypt($data, 'des3', $pass, false, '1qazxsw2');
+echo "Done";
+?>
+--EXPECT--
+Done
Modified: php/php-src/trunk/ext/openssl/openssl.c
===================================================================
--- php/php-src/trunk/ext/openssl/openssl.c 2011-02-21 08:12:33 UTC (rev 308530)
+++ php/php-src/trunk/ext/openssl/openssl.c 2011-02-21 10:07:31 UTC (rev 308531)
@@ -4741,6 +4741,7 @@
if (free_iv) {
efree(iv);
}
+ EVP_CIPHER_CTX_cleanup(&cipher_ctx);
}
/* }}} */
Added: php/php-src/trunk/ext/openssl/tests/bug54060.phpt
===================================================================
--- php/php-src/trunk/ext/openssl/tests/bug54060.phpt (rev 0)
+++ php/php-src/trunk/ext/openssl/tests/bug54060.phpt 2011-02-21 10:07:31 UTC (rev 308531)
@@ -0,0 +1,17 @@
+--TEST--
+Bug #54060 (Memory leak in openssl_encrypt)
+--SKIPIF--
+<?php if (!extension_loaded("openssl")) die("skip"); ?>
+--FILE--
+<?php
+
+$data = "jfdslkjvflsdkjvlkfjvlkjfvlkdm,4w 043920r 9234r 32904r 09243
+r7-89437 r892374 r894372 r894 7289r7 f frwerfh i iurf iuryw uyrfouiwy ruy
+972439 8478942 yrhfjkdhls";
+$pass = "r23498rui324hjbnkj";
+
+openssl_encrypt($data, 'des3', $pass, false, '1qazxsw2');
+echo "Done";
+?>
+--EXPECT--
+Done