From: Nicholas Clark Date: Thu, 18 Feb 2010 15:38:11 +0000 (+0000) Subject: Avoid a panic from the UTF-8 length cache if the length overflows 32 bits. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=566a4373528224e69d78518db4305047a2cbe53f;p=p5sagit%2Fp5-mst-13.2.git 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. --- 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;