Skip to content

Commit cc00526

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
2 parents 01634f8 + 18dc904 commit cc00526

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

ext/mbstring/mbstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5067,7 +5067,7 @@ static inline zend_string *php_mb_chr(zend_long cp, zend_string *enc_name)
50675067

50685068
no_enc = enc->no_encoding;
50695069
if (php_mb_is_unsupported_no_encoding(no_enc)) {
5070-
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", ZSTR_VAL(enc_name));
5070+
php_error_docref(NULL, E_WARNING, "Unsupported encoding \"%s\"", enc->name);
50715071
return NULL;
50725072
}
50735073

ext/mbstring/tests/bug79441.phpt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--TEST--
2+
Bug #79441 Segfault in mb_chr() if internal encoding is unsupported
3+
--SKIPIF--
4+
<?php extension_loaded('mbstring') or die('skip mbstring not available'); ?>
5+
--FILE--
6+
<?php
7+
8+
mb_internal_encoding("utf-7");
9+
mb_chr(0xd800);
10+
11+
?>
12+
--EXPECTF--
13+
Warning: mb_chr(): Unsupported encoding "UTF-7" in %s on line %d

ext/mbstring/tests/mb_chr.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ Warning: mb_chr(): Unknown encoding "typo" in %s on line %d
3030

3131
Warning: mb_chr(): Unsupported encoding "pass" in %s on line %d
3232

33-
Warning: mb_chr(): Unsupported encoding "jis" in %s on line %d
33+
Warning: mb_chr(): Unsupported encoding "JIS" in %s on line %d
3434

35-
Warning: mb_chr(): Unsupported encoding "cp50222" in %s on line %d
35+
Warning: mb_chr(): Unsupported encoding "CP50222" in %s on line %d
3636

37-
Warning: mb_chr(): Unsupported encoding "utf-7" in %s on line %d
37+
Warning: mb_chr(): Unsupported encoding "UTF-7" in %s on line %d
3838
bool(false)
3939
bool(false)
4040
bool(false)

0 commit comments

Comments
 (0)