Skip to content

Fix rendering corruption when wrapping long words #2191

Merged
jubalh merged 2 commits into
masterfrom
fix/1949
Jul 6, 2026
Merged

Fix rendering corruption when wrapping long words #2191
jubalh merged 2 commits into
masterfrom
fix/1949

Conversation

@jubalh

@jubalh jubalh commented Jul 6, 2026

Copy link
Copy Markdown
Member

No description provided.

jubalh added 2 commits July 6, 2026 10:06
When a single word is longer than the line layout limit (often happening
with ad-hoc command URIs), `_win_print_wrapped` splits and prints the
word char by char.

We used `g_utf8_strncpy(copy, word_ch, 1)` to copy a single
character. But `g_utf8_strncpy` does not null terminate the destination
buffer if the character limit is reached before encountering a NUL.

The result was stack garbage being passed to ncurses `waddstr` causing
corrupted console rendering.

Fixes: #1949
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
When users join MUCs or start chats, they may input mixed case strings
(`Room@Conference.Example.Com`).  The server normalize JIDs to
lowercase, so incoming server responses and events use lowercase.

JID based window lookups used `g_strcmp0` for case sensitive matching.
When a server response arrived for a window initialized with mixed case
the lookup failed.

Ref: #1949
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone Jul 6, 2026
@jubalh jubalh self-assigned this Jul 6, 2026
@jubalh jubalh merged commit f974840 into master Jul 6, 2026
12 checks passed
@jubalh jubalh deleted the fix/1949 branch July 6, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant