Skip to content

Commit

Permalink
Fix OpenTTD#12917: Write to negative array index for some string patt…
Browse files Browse the repository at this point in the history
…erns.

Don't popped closed pair from the parenthesis stack a second time.
  • Loading branch information
PeterN committed Sep 17, 2024
1 parent 33a7e9e commit a241ef8
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/3rdparty/icu/scriptrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,6 @@ UBool ScriptRun::next()
parenStack[++startSP].scriptCode = scriptCode;
}
}

// if this character is a close paired character,
// pop it from the stack
if (pairIndex >= 0 && (pairIndex & 1) != 0 && parenSP >= 0) {
parenSP -= 1;
startSP -= 1;
}
} else {
// if the run broke on a surrogate pair,
// end it before the high surrogate
Expand Down

0 comments on commit a241ef8

Please sign in to comment.