Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible access to unintended variable in "icu-ios/icu/source/common/utrie2_builder.cpp" line 1046 #11

Open
petrufm opened this issue Jul 13, 2018 · 0 comments

Comments

@petrufm
Copy link

petrufm commented Jul 13, 2018

While experimenting with a CodeSonar plugin we develop, we noticed a potential bug in file "icu-ios/icu/source/common/utrie2_builder.cpp" line 1046 function compactData:

movedStart=newStart-overlap;
for(i=blockCount, mapIndex=start>>UTRIE2_SHIFT_2; i>0; --i) { //HERE
trie->map[mapIndex++]=movedStart;
movedStart+=UTRIE2_DATA_BLOCK_LENGTH;
}

Shouldn't movedStart be used to initialise mapIndex at the start of the loop instead of start? Similarly in line 1025. We are not very sure about this one due to our limited understanding of the code. However, we would be happy to get a deeper understanding here even if we are wrong :).

Thanks,
Petru Florin Mihancea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant