diff options
| author | nyamatongwe <devnull@localhost> | 2007-05-18 01:11:02 +0000 |
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2007-05-18 01:11:02 +0000 |
| commit | bf0e7573e101636abf96ec83ceb8dcbada23ea5d (patch) | |
| tree | d563330614cac8fb0b3a0069f3fdd95855af886f | |
| parent | b5f860759f0d8948cef204e78a1bad9adbcd10d8 (diff) | |
| download | scintilla-mirror-bf0e7573e101636abf96ec83ceb8dcbada23ea5d.tar.gz | |
Protection against bad UTF-8 sequences.
| -rw-r--r-- | win32/PlatWin.cxx | 2 |
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++; |
