summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-12-14 23:12:32 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-12-14 23:12:39 +0100
commit1cc59edfcc78b3c824f52f6ebf9fda92a7697eb6 (patch)
treeb223863aed838dbc02980b79f4a878b2fe76eed6
parentfa0b3201783b6e06966edf4e46645751d943d824 (diff)
downloadweechat-1cc59edfcc78b3c824f52f6ebf9fda92a7697eb6.zip
core: fix infinite loop in display when the chat area is too small (closes #2053)
-rw-r--r--ChangeLog.adoc1
-rw-r--r--src/gui/curses/gui-curses-chat.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index cdd2e8ee8..072a2e87f 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -40,6 +40,7 @@ New features::
Bug fixes::
+ * core: fix infinite loop in display when the chat area is too small (issue #2053)
* core: fix value of buffer variable "num_history" when the value defined in option weechat.history.max_commands is reached
* core: remove incorrect warning when binding keys kbd:[F10] to kbd:[F20] (issue #2039)
* core: call hook config when options are removed
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index 0caf0f90d..4ada70146 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -645,6 +645,8 @@ gui_chat_display_word (struct t_gui_window *window,
nick_offline);
}
ptr_data[pos_saved_char] = saved_char;
+ if (pos_saved_char == 0)
+ break;
ptr_data += pos_saved_char;
}
else
@@ -666,6 +668,8 @@ gui_chat_display_word (struct t_gui_window *window,
apply_style_inactive,
nick_offline);
}
+ if (!ptr_data[0])
+ break;
ptr_data += strlen (ptr_data);
}