summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-11-13 15:39:15 -0700
committerKarl Williamson <khw@cpan.org>2019-12-17 11:19:31 -0700
commit81d11450691ee281f37c6c4e8055735b972733bd (patch)
treea5ae0ca505516b3e391102045ab799a32e5d2116 /numeric.c
parent5162664ad5f98a91d900af385de396cff1a34d47 (diff)
downloadperl-81d11450691ee281f37c6c4e8055735b972733bd.tar.gz
PATCH: GH #17367 read 1 beyond end of buffer
This is a bug in grok_infnan() in which in one place it failed to check that it was reading within bounds.
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index db8197c259..142f61753a 100644
--- a/numeric.c
+++ b/numeric.c
@@ -791,6 +791,9 @@ Perl_grok_infnan(pTHX_ const char** sp, const char* send)
/* "nanq" or "nans" are ok, though generating
* these portably is tricky. */
s++;
+ if (s == send) {
+ return flags;
+ }
}
if (*s == '(') {
/* C99 style "nan(123)" or Perlish equivalent "nan($uv)". */