Fix out-of-bounds buffer read in Scintilla MMIXAL lexer

Fix off-by-1 error in the loop condition.

Apply our own minimal fix because Upstream is aware of the bug (see
https://sourceforge.net/p/scintilla/bugs/2019/) but refuses to fix it
there.

Closes #18440.
This commit is contained in:
Vadim Zeitlin
2019-07-13 17:01:10 +02:00
parent b92c30191c
commit 6cdf22b5dd

View File

@@ -103,7 +103,7 @@ static void ColouriseMMIXALDoc(Sci_PositionU startPos, Sci_Position length, int
char s[100];
sc.GetCurrent(s, sizeof(s));
if (*s == ':') { // ignore base prefix for match
for (size_t i = 0; i != sizeof(s); ++i) {
for (size_t i = 0; i != sizeof(s)-1; ++i) {
*(s+i) = *(s+i+1);
}
}