summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2010-02-18 15:38:11 +0000
committerNicholas Clark <nick@ccl4.org>2010-02-18 15:52:10 +0000
commit566a4373528224e69d78518db4305047a2cbe53f (patch)
treef1c1f1295e93be270d915de75998856cb08fe0f0
parent703c388dcb4a811f77272cdb5e507d0bbc23dca7 (diff)
downloadperl-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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 40c95d52c0..53e3410f1e 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;