summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Mausz <manuel@mausz.at>2019-06-04 00:29:09 +0200
committerSteve Hay <steve.m.hay@googlemail.com>2019-10-14 21:51:44 +0100
commit0cf12f9141b0421d5ba8ec9aa40ebc92e4590548 (patch)
treeace54d0906c115d2f05119e0a61430660d5fccb2
parentc370a304bd0ff394f6c5f94efbbba3d2da72faa7 (diff)
downloadperl-0cf12f9141b0421d5ba8ec9aa40ebc92e4590548.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. (cherry picked from commit 79e302e6c3f815bf4cb72a5bacc3012595970db9)
-rw-r--r--mg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mg.c b/mg.c
index afe452fc5d..910bbd19cb 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)