summaryrefslogtreecommitdiff
path: root/cpan/Encode/Encode.xs
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-11-07 11:37:34 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2014-11-07 12:48:51 +0000
commit44f85850d172082a150f79f5a9bdcfe9d9c59d84 (patch)
treebdbfc797a49bef3119b6c1fb0790c2bc0580d86f /cpan/Encode/Encode.xs
parentac681bb324daa37001a1a03002e1d02efbaf7fcd (diff)
downloadperl-44f85850d172082a150f79f5a9bdcfe9d9c59d84.tar.gz
Update Encode to CPAN version 2.64
[DELTA] $Revision: 2.64 $ $Date: 2014/10/29 15:37:54 $ ! t/utf8warnings.t MANIFEST Retouch pull #26 so it works with perl < 5.14 ! Encode.pm + t/utf8warnings.t Pulled: Catch and re-issue utf8 warnings at a higher level https://github.com/dankogai/p5-encode/pull/26 + Encode.xs Pulled: Validate continuations in the incremental UTF-X decoder https://github.com/dankogai/p5-encode/pull/25
Diffstat (limited to 'cpan/Encode/Encode.xs')
-rw-r--r--cpan/Encode/Encode.xs12
1 files changed, 8 insertions, 4 deletions
diff --git a/cpan/Encode/Encode.xs b/cpan/Encode/Encode.xs
index 755d6d910d..32be9b8ab7 100644
--- a/cpan/Encode/Encode.xs
+++ b/cpan/Encode/Encode.xs
@@ -1,5 +1,5 @@
/*
- $Id: Encode.xs,v 2.30 2014/10/19 07:01:15 dankogai Exp $
+ $Id: Encode.xs,v 2.31 2014/10/29 15:37:54 dankogai Exp dankogai $
*/
#define PERL_NO_GET_CONTEXT
@@ -343,10 +343,14 @@ process_utf8(pTHX_ SV* dst, U8* s, U8* e, SV *check_sv,
if (UTF8_IS_START(*s)) {
U8 skip = UTF8SKIP(s);
if ((s + skip) > e) {
- /* Partial character */
- /* XXX could check that rest of bytes are UTF8_IS_CONTINUATION(ch) */
- if (stop_at_partial || (check & ENCODE_STOP_AT_PARTIAL))
+ if (stop_at_partial || (check & ENCODE_STOP_AT_PARTIAL)) {
+ const U8 *p = s + 1;
+ for (; p < e; p++) {
+ if (!UTF8_IS_CONTINUATION(*p))
+ goto malformed_byte;
+ }
break;
+ }
goto malformed_byte;
}