On 11/25/2010 08:54 PM, Chip Salzenberg wrote: > On Thu, Nov 25, 2010 at 7:47 PM, Chip Salzenberg<rev.chip@gmail.com> wrote: >> I've uncovered the string that's causing this problem. When the >> attached string has the utf8 bit enabled and a regex is applied, Perl >> dies with the above exception. Fortunately, utf8::valid() returns >> false.... > > I attached the wrong string. That one was the one that Encode::Guess > misinterpreted. This one, though, is the one that crashes Perl. I may have fixed this problem with commit 45d91b83242e04182e545e492a98ea94c6f0b3d6 but I don't seem to be able to reproduce the original with the given information about how to cause it, even on 5.12.1, where it was found. Tom Christiansen spotted a problem, and furnished a simple test case, and I was able to track his down. It turns out that an array was being allocated assuming that the largest possible UTF-8 encoded character occupies 11 bytes. But in fact the largest can occupy 13. The failing assertion protects against the array index being out-of-bounds.Thread Previous | Thread Next