mirror of
https://github.com/Perl/perl5.git
synced 2026-01-27 01:44:43 +00:00
locale.c: get_displayable_string: Check bad input
Just refuse to go out of bounds on an empty string
This commit is contained in:
parent
2d34d1ba74
commit
e945ef1bb8
4
locale.c
4
locale.c
@ -6478,6 +6478,10 @@ S_get_displayable_string(pTHX_
|
||||
bool first_time = TRUE;
|
||||
char * ret;
|
||||
|
||||
if (e <= s) {
|
||||
return "";
|
||||
}
|
||||
|
||||
/* Worst case scenario: All are non-printable so have a blank between each.
|
||||
* If UTF-8, all are the largest possible code point; otherwise all are a
|
||||
* single byte. '(2 + 1)' is from each byte takes 2 characters to
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user