diff options
author | Unknown <nyamatongwe@gmail.com> | 2013-08-07 16:59:35 +1000 |
---|---|---|
committer | Unknown <nyamatongwe@gmail.com> | 2013-08-07 16:59:35 +1000 |
commit | 3d10a17720412aa7776b72966b39b912f3d4363b (patch) | |
tree | 7bfe581e6daf85739c8a970775360b31ef81f0f7 | |
parent | 85441d442a67ecae557e7ec74409d0dc1e3c1cac (diff) | |
download | scintilla-mirror-3d10a17720412aa7776b72966b39b912f3d4363b.tar.gz |
Ensure no reads outside allocation.
-rw-r--r-- | src/PositionCache.cxx | 2 |
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)) { |