Skip to content

Commit

Permalink
Add missing boundary check to grok_infnan
Browse files Browse the repository at this point in the history
The grok_infnan() function was walking past the end of the string
while skipping over trailing '0' characters. This another variation
of Perl#17370.
  • Loading branch information
lightsey committed Aug 20, 2020
1 parent 69e830a commit 5e4e461
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ Perl_grok_infnan(pTHX_ const char** sp, const char* send)
s++; if (s == send || isALPHA_FOLD_NE(*s, 'Y')) return fail;
s++;
} else if (odh) {
while (*s == '0') { /* 1.#INF00 */
while (s < send && *s == '0') { /* 1.#INF00 */
s++;
}
}
Expand Down

0 comments on commit 5e4e461

Please sign in to comment.