1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 17:23:15 +02:00

relay: fix crash when sending data to a remote buffer when the remote has been deleted (issue #2157)

This commit is contained in:
Sébastien Helleu
2024-07-16 23:48:53 +02:00
parent eb7fd8ac9e
commit 43697033cf
3 changed files with 20 additions and 4 deletions
+8
View File
@@ -8,6 +8,14 @@
:see-release-notes: If you are upgrading: please see release notes.
:breaking: pass:quotes[*[breaking]*]
[[v4.3.6]]
== Version 4.3.6 (under dev)
[[v4.3.6_fixed]]
=== Fixed
* relay/api: fix crash when sending data to a remote buffer when the remote has been deleted (issue #2157)
[[v4.3.5]]
== Version 4.3.5 (2024-07-16)
+5
View File
@@ -11,6 +11,11 @@ It is recommended to read it when upgrading to a new stable version. +
For a complete list of changes, please look at ChangeLog.
[[v4.3.6]]
== Version 4.3.6 (under dev)
No release notes.
[[v4.3.5]]
== Version 4.3.5 (2024-07-16)
@@ -444,14 +444,17 @@ relay_remote_event_buffer_input_cb (const void *pointer,
struct t_gui_buffer *buffer,
const char *input_data)
{
struct t_relay_remote *remote;
struct t_relay_remote *ptr_remote;
cJSON *json, *json_body;
long long buffer_id;
/* make C compiler happy */
(void) pointer;
(void) data;
remote = (struct t_relay_remote *)pointer;
ptr_remote = relay_remote_search (weechat_buffer_get_string (buffer, "localvar_relay_remote"));
if (!ptr_remote)
return WEECHAT_RC_OK;
json = NULL;
@@ -475,7 +478,7 @@ relay_remote_event_buffer_input_cb (const void *pointer,
cJSON_CreateString (input_data));
cJSON_AddItemToObject (json, "body", json_body);
relay_remote_network_send_json (remote, json);
relay_remote_network_send_json (ptr_remote, json);
cJSON_Delete (json);
@@ -643,7 +646,7 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer)
{
ptr_buffer = weechat_buffer_new_props (
full_name, buffer_props,
&relay_remote_event_buffer_input_cb, event->remote, NULL,
&relay_remote_event_buffer_input_cb, NULL, NULL,
NULL, NULL, NULL);
apply_props = 0;
}