Skip to content

Commit 018251a

Browse files
committed
Fixed bug #71876
This is a backport of fcdc0a6 to the PHP-7.3 branch. We need to make sure that OnUpdateString is also called for a NULL value, otherwise the reset of the encoding at the end of the request will not work. I believe I already tried to land this before once, but it didn't actually end up on the PHP-7.3 branch due to a push conflict that I only noticed just now.
1 parent 1752393 commit 018251a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? ????, PHP 7.3.15
44

5+
- Core:
6+
. Fixed bug #71876 (Memory corruption htmlspecialchars(): charset `*' not
7+
supported). (Nikita)
8+
59
- CURL:
610
. Fixed bug #79078 (Hypothetical use-after-free in curl_multi_add_handle()).
711
(cmb)

main/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,8 @@ static PHP_INI_DISP(display_errors_mode)
588588
*/
589589
static PHP_INI_MH(OnUpdateDefaultCharset)
590590
{
591+
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
591592
if (new_value) {
592-
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
593593
#ifdef PHP_WIN32
594594
php_win32_cp_do_update(ZSTR_VAL(new_value));
595595
#endif
@@ -602,8 +602,8 @@ static PHP_INI_MH(OnUpdateDefaultCharset)
602602
*/
603603
static PHP_INI_MH(OnUpdateInternalEncoding)
604604
{
605+
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
605606
if (new_value) {
606-
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
607607
#ifdef PHP_WIN32
608608
php_win32_cp_do_update(ZSTR_VAL(new_value));
609609
#endif
@@ -616,8 +616,8 @@ static PHP_INI_MH(OnUpdateInternalEncoding)
616616
*/
617617
static PHP_INI_MH(OnUpdateInputEncoding)
618618
{
619+
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
619620
if (new_value) {
620-
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
621621
#ifdef PHP_WIN32
622622
php_win32_cp_do_update(NULL);
623623
#endif
@@ -630,8 +630,8 @@ static PHP_INI_MH(OnUpdateInputEncoding)
630630
*/
631631
static PHP_INI_MH(OnUpdateOutputEncoding)
632632
{
633+
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
633634
if (new_value) {
634-
OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
635635
#ifdef PHP_WIN32
636636
php_win32_cp_do_update(NULL);
637637
#endif

0 commit comments

Comments
 (0)