aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2007-05-18 01:11:02 +0000
committernyamatongwe <devnull@localhost>2007-05-18 01:11:02 +0000
commitbf0e7573e101636abf96ec83ceb8dcbada23ea5d (patch)
treed563330614cac8fb0b3a0069f3fdd95855af886f
parentb5f860759f0d8948cef204e78a1bad9adbcd10d8 (diff)
downloadscintilla-mirror-bf0e7573e101636abf96ec83ceb8dcbada23ea5d.tar.gz
Protection against bad UTF-8 sequences.
-rw-r--r--win32/PlatWin.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index f9a9fa1c5..36479e0f2 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -787,7 +787,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, int *positi
} else if (uch >= (0x80)) {
lenChar = 2;
}
- for (unsigned int bytePos=0; bytePos<lenChar; bytePos++) {
+ for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) {
positions[i++] = poses[ui];
}
ui++;