godot icon indicating copy to clipboard operation
godot copied to clipboard

Fix RichTextLabel crash with out of bound exception

Open pfertyk opened this issue 3 years ago • 4 comments

Fixes #68242.

I am not completely sure how the _find_list method works :sweat_smile: This check will stop the error from happening, but perhaps the iteration itself is not valid now. We are iterating over list and prev_item and then using the index to access frame->lines, and I'm not sure if that process is correct. If this fix should be implemented differently, please let me know :smile:

pfertyk avatar Nov 06 '22 12:11 pfertyk

None of your builds seem to have to pass. Please do a rebase and try building it locally again to see if this is even valid.

YuriSizov avatar Feb 08 '23 12:02 YuriSizov

Rebase done, but I can see the warnings. I'll check if I can do something about them next week.

pfertyk avatar Feb 08 '23 21:02 pfertyk

error: comparison of integers of different signs: 'int' and 'unsigned int'

is the error you're getting.

YuriSizov avatar Feb 08 '23 22:02 YuriSizov

While this would fix the crash, I'm not sure why we arrive in this state in the first place. It feels like there is some underlying problem (and of course the reported issue is completely artificial, which might be the reason for this weird state).

But if @bruvzg approves, I think we can merge it as is.

YuriSizov avatar Mar 07 '23 13:03 YuriSizov

Thanks!

YuriSizov avatar Mar 08 '23 10:03 YuriSizov

Cherry-picked for 4.0.1.

YuriSizov avatar Mar 13 '23 13:03 YuriSizov