Skip to content

Commit 6d87235

Browse files
authored
avoid potential out-of-bounds array access (undefined behaviour)
This is a backport of a fix from mapnik clone of this class: mapnik/mapnik#4096 Also suggested to icu as: https://unicode-org.atlassian.net/browse/ICU-20824 We encountered it in mapnik and fixed it in our own mapnik 3.0 fork. I think it worth backporting the fix to here as well.
1 parent 48597a4 commit 6d87235

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

icu4c/source/extra/scrptrun/scrptrun.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ UBool ScriptRun::next()
155155
if ((pairIndex & 1) == 0) {
156156
parenStack[++parenSP].pairIndex = pairIndex;
157157
parenStack[parenSP].scriptCode = scriptCode;
158+
startSP = parenSP;
158159
} else if (parenSP >= 0) {
159160
int32_t pi = pairIndex & ~1;
160161

0 commit comments

Comments
 (0)