Skip to content

Commit 38628e8

Browse files
iliaaliluuu1994
authored andcommitted
Fix phpGH-17399: iconv memory leak on bailout
Wrap bailable sections in php_iconv_string(), _php_iconv_substr(), _php_iconv_mime_encode(), and _php_iconv_mime_decode() with zend_try/zend_catch to ensure iconv handles allocated via system malloc are closed if a Zend OOM bailout fires during smart_str or zend_string operations. Fixes phpGH-17399 Closes phpGH-21541
1 parent 86c4877 commit 38628e8

6 files changed

Lines changed: 718 additions & 632 deletions

File tree

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ PHP NEWS
66
. Fixed bug GH-19983 (GC assertion failure with fibers, generators and
77
destructors). (iliaal)
88

9+
- Iconv:
10+
. Fixed bug GH-17399 (iconv memory leak on bailout). (iliaal)
11+
912
- SPL:
1013
. Fixed bug GH-21499 (RecursiveArrayIterator getChildren UAF after parent
1114
free). (Girgias)

0 commit comments

Comments
 (0)