php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch mcrypt-filter-uaf for mcrypt related Bug #72535

Patch version 2017-01-10 12:52 UTC

Return to Bug #72535 | Download this patch
Patch Revisions:

Developer: leigh@php.net

diff --git a/ext/mcrypt/mcrypt_filter.c b/ext/mcrypt/mcrypt_filter.c
index cfaf25c..fcb5064 100644
--- a/ext/mcrypt/mcrypt_filter.c
+++ b/ext/mcrypt/mcrypt_filter.c
@@ -89,7 +89,7 @@ static php_stream_filter_status_t php_mcrypt_filter(
                        php_stream_bucket_delref(bucket TSRMLS_CC);
                } else {
                        /* Stream cipher */
-                       php_stream_bucket_make_writeable(bucket TSRMLS_CC);
+                       bucket = php_stream_bucket_make_writeable(bucket TSRMLS_CC);
                        if (data->encrypt) {
                                mcrypt_generic(data->module, bucket->buf, bucket->buflen);
                        } else {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 14:01:29 2024 UTC