summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-01-08 17:38:37 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-01-08 17:38:37 +0100
commitf305eed01f5c183ab8c3bb83ea631128cf480be8 (patch)
treedd74cb17e29f7c2a09a3d85ef4e0c09801bb6b4f /src/plugins
parent43d3a978691723be663b93e23bace4f3f1033d8e (diff)
downloadweechat-f305eed01f5c183ab8c3bb83ea631128cf480be8.zip
typing: fix crash when pointer buffer is not received in callback for signal "input_text_changed" (closes #1869)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/typing/typing.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/typing/typing.c b/src/plugins/typing/typing.c
index f7d2edd4e..ff8ece005 100644
--- a/src/plugins/typing/typing.c
+++ b/src/plugins/typing/typing.c
@@ -94,7 +94,7 @@ typing_buffer_closing_signal_cb (const void *pointer, void *data,
}
/*
- * Callback for signal "buffer_closing".
+ * Callback for signal "input_text_changed".
*/
int
@@ -113,7 +113,12 @@ typing_input_text_changed_signal_cb (const void *pointer, void *data,
(void) signal;
(void) type_data;
+ if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_POINTER) != 0)
+ return WEECHAT_RC_OK;
+
ptr_buffer = (struct t_gui_buffer *)signal_data;
+ if (!ptr_buffer)
+ return WEECHAT_RC_OK;
/* ignore any change in input if the user is searching text in the buffer */
text_search = weechat_buffer_get_integer (ptr_buffer, "text_search");