Skip to content

Commit 79e302e

Browse files
manuelmtonycoz
authored andcommitted
(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.
1 parent 3127113 commit 79e302e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3178,7 +3178,8 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
31783178
{
31793179
const char *p = SvPV_const(sv, len);
31803180
Groups_t *gary = NULL;
3181-
const char* endptr = p + len;
3181+
const char* p_end = p + len;
3182+
const char* endptr = p_end;
31823183
UV uv;
31833184
#ifdef _SC_NGROUPS_MAX
31843185
int maxgrp = sysconf(_SC_NGROUPS_MAX);
@@ -3201,6 +3202,7 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg)
32013202
if (endptr == NULL)
32023203
break;
32033204
p = endptr;
3205+
endptr = p_end;
32043206
while (isSPACE(*p))
32053207
++p;
32063208
if (!*p)

0 commit comments

Comments
 (0)