This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23359a6
)
toke.c: Replace infinite loop reading input by bounded
author
Karl Williamson
<khw@cpan.org>
Tue, 13 Dec 2016 02:42:23 +0000
(19:42 -0700)
committer
Karl Williamson
<khw@cpan.org>
Fri, 23 Dec 2016 23:48:35 +0000
(16:48 -0700)
It's safer to have an upper limit on how far you look in your input.
toke.c
patch
|
blob
|
blame
|
history
diff --git
a/toke.c
b/toke.c
index
09fcddc
..
489e772
100644
(file)
--- a/
toke.c
+++ b/
toke.c
@@
-8987,7
+8987,7
@@
S_parse_ident(pTHX_ char **s, char **d, char * const e, int allow_package,
{
PERL_ARGS_ASSERT_PARSE_IDENT;
-
for (;;
) {
+
while (*s < PL_bufend
) {
if (*d >= e)
Perl_croak(aTHX_ "%s", ident_too_long);
if (is_utf8 && isIDFIRST_utf8_safe(*s, PL_bufend)) {