aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <nyamatongwe@gmail.com>2013-08-07 16:59:35 +1000
committernyamatongwe <nyamatongwe@gmail.com>2013-08-07 16:59:35 +1000
commitfb79f322401ab6a776f4be06a4e0b4601409dcec (patch)
treeedd2dff9a0215f47939b3603bf5daec2e8ed5238
parent28f221692fdfbd3943fbab0d2f65a72923b8b6e7 (diff)
downloadscintilla-mirror-fb79f322401ab6a776f4be06a4e0b4601409dcec.tar.gz
Ensure no reads outside allocation.
-rw-r--r--src/PositionCache.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index d833ac982..7201ff548 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -461,7 +461,7 @@ TextSegment BreakFinder::Next() {
else if (encodingFamily == efDBCS)
charWidth = pdoc->IsDBCSLeadByte(ll->chars[nextBreak]) ? 2 : 1;
Representation *repr = preprs->RepresentationFromCharacter(ll->chars + nextBreak, charWidth);
- if ((ll->styles[nextBreak] != ll->styles[nextBreak - 1]) ||
+ if (((nextBreak > 0) && (ll->styles[nextBreak] != ll->styles[nextBreak - 1])) ||
repr ||
(nextBreak == saeNext)) {
while ((nextBreak >= saeNext) && (saeNext < lineEnd)) {