This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8n_to_uvchr(): Reduce chances of reading beyond buffer
utf8n_to_uvchr() can be called incorrectly, leading it to believe the
buffer is longer than it actually is. But often, it will be called with
NUL terminated strings, so it can reduce it's chances of being fooled by
refusing to read beyond a NUL. The NUL will terminate any UTF-8 byte
sequence, and the only reason to read beyond it would be to print all
the expected bytes in the sequence.
This commit is not the final word, but it is an easy fix for a common
case.