diff options
author | Karl Williamson <khw@cpan.org> | 2019-10-23 21:19:47 -0600 |
---|---|---|
committer | Nicolas R <atoomic@cpan.org> | 2019-11-08 12:01:13 -0700 |
commit | 5738fd423d16ea7bd432e3bca55c98d22996bbfd (patch) | |
tree | fb2d3d331231d009d0b2082c8ab275a99ae48fd2 | |
parent | 669daf6d37a54e059ff78eca20b61308db2113bd (diff) | |
download | perl-5738fd423d16ea7bd432e3bca55c98d22996bbfd.tar.gz |
utf8_to_uvchr_buf() Return proper length
When input UTF-8 is 13 bytes, return 13, even on 32 bit machines where
overflow happens at 7 UTF-8 bytes.
(cherry picked from commit f379e2ee4277fc855a37b82c6c94294c4e0e8c8d)
Signed-off-by: Nicolas R <atoomic@cpan.org>
-rw-r--r-- | dist/Devel-PPPort/parts/inc/utf8 | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/dist/Devel-PPPort/parts/inc/utf8 b/dist/Devel-PPPort/parts/inc/utf8 index 9cb245457d..a0d45d46ef 100644 --- a/dist/Devel-PPPort/parts/inc/utf8 +++ b/dist/Devel-PPPort/parts/inc/utf8 @@ -250,7 +250,7 @@ utf8_to_uvchr_buf(pTHX_ const U8 *s, const U8 *send, STRLEN *retlen) * than 31 bits */ if (sizeof(ret) < 8) { overflows = 1; - overflow_length = 7; + overflow_length = (*s == 0xFE) ? 7 : 13; } else { const U8 highest[] = /* 2*63-1 */ |