summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-03-28 18:22:11 -0600
committerKarl Williamson <khw@cpan.org>2019-03-28 18:54:51 -0600
commitb7502288af31c8825a7da7573538e6ce58a641c3 (patch)
treeee4b4662f65ba9adf9b9b213239038378dca1359 /utf8.c
parentca21d46d3db8b4555070f23307b87ad37f93afe7 (diff)
downloadperl-b7502288af31c8825a7da7573538e6ce58a641c3.tar.gz
PATCH: [perl #133347] Tk broken
This was caused by utf8_to_uvchr() failing to set the returned ptr in some circumstances, leading to reading uninitialized memory. A test failure remains, and I'll wait for Slaven's feedback before looking further into that. It is in t/photo.t couldn't recognize image data at blib/lib/Tk/Image.pm line 21. # Looks like your test exited with 255 just after 100 And it's trying at that point to look at 'Xcamel.gif'
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/utf8.c b/utf8.c
index b9772b43b8..e479400b71 100644
--- a/utf8.c
+++ b/utf8.c
@@ -5481,6 +5481,9 @@ Perl_utf8_to_uvchr(pTHX_ const U8 *s, STRLEN *retlen)
* handled the same way, speeding up this common case */
if (UTF8_IS_INVARIANT(*s)) { /* Assumes 's' contains at least 1 byte */
+ if (retlen) {
+ *retlen = 1;
+ }
return (UV) *s;
}