summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorManuel Mausz <manuel@mausz.at>2019-06-04 00:29:09 +0200
committerTony Cook <tony@develop-help.com>2019-06-19 11:25:26 +1000
commit79e302e6c3f815bf4cb72a5bacc3012595970db9 (patch)
treefe7c92719ab064b99069694b816e85139235eff0 /mg.c
parent3127113cbf175740dce688a3320c9d62ece9b910 (diff)
downloadperl-79e302e6c3f815bf4cb72a5bacc3012595970db9.tar.gz
(perl #134169) mg.c reset endptr after use
Perl_grok_atoUV has been changed so endptr constraints the input. Thus we need to reset the endptr after every use.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index 26211dd4d0..f235f0ee5a 100644
--- a/mg.c
+++ b/mg.c
@@ -3178,7 +3178,8 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
{
const char *p = SvPV_const(sv, len);
Groups_t *gary = NULL;
- const char* endptr = p + len;
+ const char* p_end = p + len;
+ const char* endptr = p_end;
UV uv;
#ifdef _SC_NGROUPS_MAX
int maxgrp = sysconf(_SC_NGROUPS_MAX);
@@ -3201,6 +3202,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
if (endptr == NULL)
break;
p = endptr;
+ endptr = p_end;
while (isSPACE(*p))
++p;
if (!*p)