From 566a4373528224e69d78518db4305047a2cbe53f Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 18 Feb 2010 15:38:11 +0000 Subject: [PATCH] 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. --- sv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sv.c b/sv.c index 40c95d5..53e3410 100644 --- a/sv.c +++ b/sv.c @@ -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; -- 2.7.4