diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-02-18 15:38:11 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-02-18 15:52:10 +0000 |
commit | 566a4373528224e69d78518db4305047a2cbe53f (patch) | |
tree | f1c1f1295e93be270d915de75998856cb08fe0f0 | |
parent | 703c388dcb4a811f77272cdb5e507d0bbc23dca7 (diff) | |
download | perl-566a4373528224e69d78518db4305047a2cbe53f.tar.gz |
Avoid a panic from the UTF-8 length cache if the length overflows 32 bits.
Rather than storing a value, and having it wrap to a wrong value, treat such
lengths as "still unknown". This is a work around until a proper solution is
designed an implemented.
-rw-r--r-- | sv.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -6072,6 +6072,10 @@ Perl_sv_len_utf8(pTHX_ register SV *const sv) } assert(mg); mg->mg_len = ulen; + /* For now, treat "overflowed" as "still unknown". + See RT #72924. */ + if (ulen != (STRLEN) mg->mg_len) + mg->mg_len = -1; } } return ulen; |