summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2016-09-13 21:53:48 +0200
committerYves Orton <demerphq@gmail.com>2016-09-13 21:53:48 +0200
commit6dcba01ee118c0d387f72735f7c417e946d824a1 (patch)
treedf5c4ad56a81c94801ebe37a6adf119bffdb1a6a /gv.c
parent50d6d1b7e28e5f1e74eb8a9267cd1d05bcfab5a5 (diff)
downloadperl-6dcba01ee118c0d387f72735f7c417e946d824a1.tar.gz
Revert "fix: [perl #129267] Possible string overrun with invalid len in gv.c"
This reverts commit b053c9385f29680bc812db3da64ce5c4d45d0cf7.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gv.c b/gv.c
index 23700a0106..1bc8bf2d9d 100644
--- a/gv.c
+++ b/gv.c
@@ -1009,7 +1009,6 @@ GV *
Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN len, U32 flags)
{
const char *nend;
- const char * const name_end= name + len;
const char *nsplit = NULL;
GV* gv;
HV* ostash = stash;
@@ -1029,15 +1028,15 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le
the error reporting code. */
}
- for (nend = name; nend < name_end && *nend; nend++) {
+ for (nend = name; *nend || nend != (origname + len); nend++) {
if (*nend == '\'') {
nsplit = nend;
name = nend + 1;
}
- else if (*nend == ':' && nend+1 < name_end && *(nend + 1) == ':') {
- nsplit = nend++;
- name = nend + 1;
- }
+ else if (*nend == ':' && *(nend + 1) == ':') {
+ nsplit = nend++;
+ name = nend + 1;
+ }
}
if (nsplit) {
if ((nsplit - origname) == 5 && memEQ(origname, "SUPER", 5)) {