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

manually handle NUL unicode in g_utf8_get_next_char_validated #1183

Merged
merged 1 commit into from Jul 8, 2020

Conversation

ailin-nemui
Copy link
Contributor

@ailin-nemui ailin-nemui commented Apr 28, 2020

A change in GLib 2.63 broke some assumptions in Irssi that the null-byte NUL / U+0000 is a valid Unicode character. This would occur when the user types Ctrl+Space. As a result, the input loop never manages to process the NUL-byte (and any other user input that follows, ever).

This patch adds a manual check that properly advances the input loop if GLib returns -2 (incomplete character) despite the length being positive and a NUL is in first position.

Fixes #1180
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/967
https://gitlab.gnome.org/GNOME/glib/-/issues/2093

@dequis
Copy link
Member

dequis commented Apr 28, 2020

Much neater message, thanks!

Sorry for being annoying about this but: Can you also --amend that message to the commit itself? I suspect we might end up seeing that commit turned as a patch file as part of distro packages for a while.

A change in GLib 2.63 broke some assumptions in Irssi that the null-byte
NUL / U+0000 is a valid Unicode character. This would occur when the
user types Ctrl+Space. As a result, the input loop never manages to
process the NUL-byte (and any other user input that follows, ever).

This patch adds a manual check that properly advances the input loop if
GLib returns -2 (incomplete character) despite the length being positive
and a NUL is in first position.

Fixes irssi#1180
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/967
https://gitlab.gnome.org/GNOME/glib/-/issues/2093
@ailin-nemui
Copy link
Contributor Author

updated

@eqhmcow
Copy link

eqhmcow commented Jun 7, 2020

sorry to bother; but any reason this wasn't merged? or was it merged in a different commit to master?

Thank you

@LaserEyess
Copy link

What's the status on this? Some IMEs use ctrl+space to switch between layouts, which crashes irssi every time.

@felixfontein
Copy link

@ailin-nemui is there a chance that this could get merged (and a new irssi version released soon)? This bug is really annoying, since I have to kill irssi every time it happens :)

@ailin-nemui
Copy link
Contributor Author

hi @felixfontein even if there were an Irssi release there is nothing guaranteeing you that distributions would ship the update

@ailin-nemui ailin-nemui added the auto-merge This PR is scheduled for merge if no further comments are opened label Jul 8, 2020
@ailin-nemui
Copy link
Contributor Author

@irssi/developers

@felixfontein
Copy link

@ailin-nemui true, but it definitely increases the chances! Thanks a lot :)

@LaserEyess
Copy link

Just want to say I have been using a patched irssi for over a week now and this does fix the issue, in case you were waiting on user testing. I also disagree that there is 'no guarantee' that distros will ship this update. For distros affected by newer glibs and irssi, the most likely will if this fix is approved, either through backporting the fix or by updating irssi in their repos.

@ailin-nemui
Copy link
Contributor Author

@LaserEyess they can already do that now, though. (as some have)

@ailin-nemui ailin-nemui merged commit 7680298 into irssi:master Jul 8, 2020
@ailin-nemui ailin-nemui deleted the glib-2-63 branch July 8, 2020 16:17
@felixfontein
Copy link

@ailin-nemui thank you very much for fixing this!

ailin-nemui added a commit that referenced this pull request Apr 8, 2021
manually handle NUL unicode in g_utf8_get_next_char_validated

(cherry picked from commit 7680298)
@ailin-nemui ailin-nemui added this to the 1.2.3 milestone Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge This PR is scheduled for merge if no further comments are opened z-affects-1.2.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ctrl+space freezes irssi on GLib >2.62
5 participants