summaryrefslogtreecommitdiff
path: root/src/plugins/xfer
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-10-30 12:28:00 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-10-30 23:10:54 +0100
commite8a4c1d813f59db3dbec525cdeec08a20bd5cfda (patch)
tree1e62e18b509532f335c577054bcb9aa8ec7e1458 /src/plugins/xfer
parent4d884729f9c5fe189c48600ad7fa2d4fb3d0fd88 (diff)
downloadweechat-e8a4c1d813f59db3dbec525cdeec08a20bd5cfda.zip
xfer: fix use of uninitialized variable when adding a new xfer
Diffstat (limited to 'src/plugins/xfer')
-rw-r--r--src/plugins/xfer/xfer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c
index d775f7512..314c512b1 100644
--- a/src/plugins/xfer/xfer.c
+++ b/src/plugins/xfer/xfer.c
@@ -1064,6 +1064,9 @@ xfer_add_cb (const void *pointer, void *data,
token = weechat_infolist_string (infolist, "token");
protocol = XFER_NO_PROTOCOL;
+ memset (&local_addr_storage, 0, sizeof (local_addr_storage));
+ local_addr_length = sizeof (local_addr_storage);
+
if (!plugin_name || !plugin_id || !str_type || !remote_nick || !local_nick)
{
weechat_printf (NULL,
@@ -1234,8 +1237,6 @@ xfer_add_cb (const void *pointer, void *data,
{
/* no own_ip, so bind_addr's family comes from irc connection */
/* use the local interface, from the server socket */
- memset (&local_addr_storage, 0, sizeof (local_addr_storage));
- local_addr_length = sizeof (local_addr_storage);
server_sock = weechat_infolist_integer (infolist, "socket");
if (getsockname (server_sock, (struct sockaddr *)&local_addr_storage, &local_addr_length))
{