diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-07 05:33:24 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-08 08:15:59 -0800 |
commit | 6a642c21192e08a710804b462f8c97902797d5b4 (patch) | |
tree | 27b72711b29852a906f0134f3c962d52618b00c4 /toke.c | |
parent | a96df643850d22bc4a943802c3dd142af0ab0057 (diff) | |
download | perl-6a642c21192e08a710804b462f8c97902797d5b4.tar.gz |
Make _charnames comparison null-safe
This comparison in toke.c checks whether the charnames translators is
the core’s own and, if so, skips certain validation checks.
Charnames translators coming from any package beginning with
"_charnames\0" would also be exempt from the checks, because the name
comparison stopped at the first null.
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2859,7 +2859,8 @@ S_get_and_check_backslash_N_name(pTHX_ const char* s, const char* const e) SvTYPE(rv) == SVt_PVCV) && ((stash = CvSTASH(rv)) != NULL)) { const char * const name = HvNAME(stash); - if strEQ(name, "_charnames") { + if (HvNAMELEN(stash) == sizeof("_charnames")-1 + && strEQ(name, "_charnames")) { return res; } } |