From 3ff417bf5e9a53af3d1a037e09de5a5a8536d77c Mon Sep 17 00:00:00 2001 From: mitchell Date: Wed, 17 Jun 2020 18:03:50 -0400 Subject: Backport: Bug [#2019]. Fix buffer over-read with absolute reference. Backport of changeset 8212:6d0ce3c92a13, but without lexilla tests. --- lexers/LexMMIXAL.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lexers/LexMMIXAL.cxx b/lexers/LexMMIXAL.cxx index 0917b5d0a..49b639dd2 100644 --- a/lexers/LexMMIXAL.cxx +++ b/lexers/LexMMIXAL.cxx @@ -99,12 +99,11 @@ static void ColouriseMMIXALDoc(Sci_PositionU startPos, Sci_Position length, int } } else if (sc.state == SCE_MMIXAL_REF) { // REF if (!IsAWordChar(sc.ch) ) { - char s[100]; - sc.GetCurrent(s, sizeof(s)); + char s0[100]; + sc.GetCurrent(s0, sizeof(s0)); + const char *s = s0; if (*s == ':') { // ignore base prefix for match - for (size_t i = 0; i != sizeof(s); ++i) { - *(s+i) = *(s+i+1); - } + ++s; } if (special_register.InList(s)) { sc.ChangeState(SCE_MMIXAL_REGISTER); -- cgit v1.2.3