projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36eb48b
)
utf8.c: Prevent reading before buffer start
author
Karl Williamson
<public@khwilliamson.com>
Sun, 27 Nov 2011 22:34:52 +0000
(15:34 -0700)
committer
Karl Williamson
<public@khwilliamson.com>
Fri, 13 Jan 2012 16:58:34 +0000
(09:58 -0700)
Make sure there is something before the character being read before
reading it.
utf8.c
patch
|
blob
|
history
diff --git
a/utf8.c
b/utf8.c
index
e4b927d
..
c8c6e55
100644
(file)
--- a/
utf8.c
+++ b/
utf8.c
@@
-3495,7
+3495,9
@@
Perl__swash_to_invlist(pTHX_ SV* const swash)
/* If the ending is somehow corrupt and isn't a new line, add another
* element for the final range that isn't in the inversion list */
- if (! (*lend == '\n' || (*lend == '\0' && *(lend - 1) == '\n'))) {
+ if (! (*lend == '\n'
+ || (*lend == '\0' && (lcur == 0 || *(lend - 1) == '\n'))))
+ {
elements++;
}