From f50942068da95af1a712f3a0fd784f96ffc77027 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 8 Oct 2025 20:37:10 +0100 Subject: [PATCH 1/3] Fix GH-20106: locale methods catering to stricter C++ rules. close GH-20110 --- ext/intl/locale/locale_methods.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/ext/intl/locale/locale_methods.cpp b/ext/intl/locale/locale_methods.cpp index fd8712b3b462..2a342220c660 100644 --- a/ext/intl/locale/locale_methods.cpp +++ b/ext/intl/locale/locale_methods.cpp @@ -341,7 +341,7 @@ U_CFUNC PHP_NAMED_FUNCTION(zif_locale_set_default) * common code shared by get_primary_language,get_script or get_region or get_variant * result = 0 if error, 1 if successful , -1 if no value */ -static zend_string* get_icu_value_internal( const char* loc_name , char* tag_name, int* result , int fromParseLocale) +static zend_string* get_icu_value_internal( const char* loc_name , const char* tag_name, int* result , int fromParseLocale) { zend_string* tag_value = NULL; int32_t tag_value_len = 512; @@ -466,7 +466,7 @@ static zend_string* get_icu_value_internal( const char* loc_name , char* tag_nam * Gets the value from ICU , called when PHP userspace function is called * common code shared by get_primary_language,get_script or get_region or get_variant */ -static void get_icu_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) +static void get_icu_value_src_php( const char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { char* loc_name = NULL; @@ -544,7 +544,7 @@ U_CFUNC PHP_FUNCTION(locale_get_primary_language ) /* {{{ * common code shared by display_xyz functions to get the value from ICU }}} */ -static void get_icu_disp_value_src_php( char* tag_name, INTERNAL_FUNCTION_PARAMETERS) +static void get_icu_disp_value_src_php( const char* tag_name, INTERNAL_FUNCTION_PARAMETERS) { char* loc_name = NULL; size_t loc_name_len = 0; @@ -801,7 +801,7 @@ U_CFUNC PHP_FUNCTION(locale_canonicalize) * returns 1 if successful , -1 if not found , * 0 if array element is not a string , -2 if buffer-overflow */ -static int append_key_value(smart_str* loc_name, HashTable* hash_arr, char* key_name) +static int append_key_value(smart_str* loc_name, HashTable* hash_arr, const char* key_name) { zval *ele_value; @@ -826,7 +826,7 @@ static int append_key_value(smart_str* loc_name, HashTable* hash_arr, char* key_ /* {{{ append_prefix , appends the prefix needed * e.g. private adds 'x' */ -static void add_prefix(smart_str* loc_name, char* key_name) +static void add_prefix(smart_str* loc_name, const char* key_name) { if( strncmp(key_name , LOC_PRIVATE_TAG , 7) == 0 ){ smart_str_appendl(loc_name, SEPARATOR , sizeof(SEPARATOR)-1); @@ -842,7 +842,7 @@ static void add_prefix(smart_str* loc_name, char* key_name) * returns 1 if successful , -1 if not found , * 0 if array element is not a string , -2 if buffer-overflow */ -static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, char* key_name) +static int append_multiple_key_values(smart_str* loc_name, HashTable* hash_arr, const char* key_name) { zval *ele_value; int isFirstSubtag = 0; @@ -1053,7 +1053,7 @@ static zend_string* get_private_subtags(const char* loc_name) /* }}} */ /* {{{ code used by locale_parse */ -static int add_array_entry(const char* loc_name, zval* hash_arr, char* key_name) +static int add_array_entry(const char* loc_name, zval* hash_arr, const char* key_name) { zend_string* key_value = NULL; char* cur_key_name = NULL; From 8a21d62c281614757fbc4223a4ea950ebd9c4568 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 13 Oct 2025 08:34:03 +0200 Subject: [PATCH 2/3] Update SKIPIF for bug #67563 (#20133) --- ext/mysqli/tests/bug67563.phpt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ext/mysqli/tests/bug67563.phpt b/ext/mysqli/tests/bug67563.phpt index 72a51ecdccd2..275d79e30c79 100644 --- a/ext/mysqli/tests/bug67563.phpt +++ b/ext/mysqli/tests/bug67563.phpt @@ -6,15 +6,12 @@ mysqli --INI-- From c89f25bf6902bb97c981c2b5e7012b557f44e9ed Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Sun, 12 Oct 2025 12:57:49 +0200 Subject: [PATCH 3/3] phar: Fix file descriptor/memory leak when opening central fp fails Closes GH-20145. --- NEWS | 1 + ext/phar/zip.c | 1 + 2 files changed, 2 insertions(+) diff --git a/NEWS b/NEWS index b06b1bf300bc..8412c6c2bf48 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ PHP NEWS . Fix memory leak of argument in webPhar. (nielsdos) . Fix memory leak when setAlias() fails. (nielsdos) . Fix memory leak in phar_parse_zipfile() error handling. (nielsdos) + . Fix file descriptor/memory leak when opening central fp fails. (nielsdos) - Random: . Fix Randomizer::__serialize() w.r.t. INDIRECTs. (nielsdos) diff --git a/ext/phar/zip.c b/ext/phar/zip.c index 47a518f53ce7..c188d6513abf 100644 --- a/ext/phar/zip.c +++ b/ext/phar/zip.c @@ -1417,6 +1417,7 @@ int phar_zip_flush(phar_archive_data *phar, char *user_stub, zend_long len, int pass.centralfp = php_stream_fopen_tmpfile(); if (!pass.centralfp) { + php_stream_close(pass.filefp); goto fperror; }