summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-11-07 05:33:24 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-11-08 08:15:59 -0800
commit6a642c21192e08a710804b462f8c97902797d5b4 (patch)
tree27b72711b29852a906f0134f3c962d52618b00c4 /toke.c
parenta96df643850d22bc4a943802c3dd142af0ab0057 (diff)
downloadperl-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index d7de0dbfdf..d871fc46e7 100644
--- a/toke.c
+++ b/toke.c
@@ -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;
}
}