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:
0000ba0
)
[perl #127334] S_incline: avoid overrunning the end of the parse buffer
author
Tony Cook
<tony@develop-help.com>
Wed, 10 Feb 2016 05:03:22 +0000
(16:03 +1100)
committer
Tony Cook
<tony@develop-help.com>
Wed, 10 Feb 2016 05:03:22 +0000
(16:03 +1100)
If the rest of the allocation up to the end addressable memory was
non-spaces, this loop could cause a segmentation fault.
Avoid that by ensuring we stop when we see a NUL.
toke.c
patch
|
blob
|
blame
|
history
diff --git
a/toke.c
b/toke.c
index
4a67857
..
c3d3c97
100644
(file)
--- a/
toke.c
+++ b/
toke.c
@@
-1694,7
+1694,7
@@
S_incline(pTHX_ const char *s)
}
else {
t = s;
- while (!isSPACE(*t))
+ while (
*t &&
!isSPACE(*t))
t++;
e = t;
}