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

Textview can't get GetRegionText with colored content and panics #751

Closed
sruehl opened this issue Aug 3, 2022 · 1 comment · Fixed by #753
Closed

Textview can't get GetRegionText with colored content and panics #751

sruehl opened this issue Aug 3, 2022 · 1 comment · Fixed by #753

Comments

@sruehl
Copy link
Contributor

sruehl commented Aug 3, 2022

There is a guard to only check if the current tag currentTag has a index in colorTagIndices:

if currentTag < len(colorTagIndices) && pos >= colorTagIndices[currentTag][0] && pos < colorTagIndices[currentTag][1] {

when it hits the end tag it increments the currentTag
currentTag++

and then produces a panic in the next line because the new tag is not bound checked against colorTagIndices
if colorTagIndices[currentTag][1]-colorTagIndices[currentTag][0] > 2 {

@sruehl
Copy link
Contributor Author

sruehl commented Aug 3, 2022

so from my understanding that would be solved by changing 627 to if currentTag < len(colorTagIndices) && colorTagIndices[currentTag][1]-colorTagIndices[currentTag][0] > 2 {

sruehl added a commit to apache/plc4x that referenced this issue Aug 5, 2022
chrisdutz pushed a commit to apache/plc4x that referenced this issue Aug 10, 2022
@rivo rivo closed this as completed in 941f860 Sep 6, 2022
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

Successfully merging a pull request may close this issue.

1 participant