-
Notifications
You must be signed in to change notification settings - Fork 250
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
crash on showing specially crafted string #489
Comments
Hi, and thank you for the detailed report! Seems like we're doing something wrong there, will investigate. |
Ah yeah we totally assume that any line-breaking character is 1-byte in utf-8... smart... I pushed a tentative fix (and added this as a text case). Though now I see a new problem: ncurses behaves differently from other backends like termion/crossterm when attempting to print control characters like Ncurses tries to print something:
But rather than patching ncurses to not print them, it may be easier to sanitize the user input and remove these characters from any provided string? On the other hand, there is a longer-term plan to bring something like agavrilov/cursive_buffered_backend in cursive itself, keeping an internal character grid before flushing to the backend. If we had that, it would be easy to ignore any zero-width grapheme. |
I can't really think of any use case where you would want to print those kind of control characters "raw", maybe if want to build a hex editor, but even then you need to sanitize/replace unprintable characters with something else. |
First: is this a bug report? A suggestion? Or asking for help?
bug report
Problem description
My fuzzing found an panic inside cursive itself when displaying a string supplied from an untrusted source:
Can be replicated with with program:
Environment
locale
in a terminal).The text was updated successfully, but these errors were encountered: