Skip to content

Commit 12f6bd0

Browse files
committed
pv_uni_display: Revert use of utf8_to_ov_or_die
This fixes #23089 Croaking when someone is trying to output a malformed UTF-8 sequence turns out to be a bad idea. That should have been obvious to me. But instead of going back to the problematic utf8_to_uvchr_buf(), this commit uses the non-croaking utf8_to_uv(). Croaking should not be done when at the user interface. It makes sense, for example, when things should have already been validated and there is no good option to proceed.
1 parent e792078 commit 12f6bd0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utf8.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4781,7 +4781,7 @@ Perl_pv_uni_display(pTHX_ SV *dsv, const U8 *spv, STRLEN len, STRLEN pvlim,
47814781
break;
47824782
}
47834783

4784-
u = utf8_to_uv_or_die(s, e, &next_len);
4784+
(void) utf8_to_uv(s, e, &u, &next_len);
47854785
assert(next_len > 0);
47864786

47874787
if (u < 256) {

0 commit comments

Comments
 (0)