summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2016-10-30 07:07:29 +0100
committerSébastien Helleu <flashcode@flashtux.org>2016-10-30 07:07:29 +0100
commit335ab22a553cc47b1b2acb95c3899e4bcea7ac36 (patch)
treefeecaad0134e5a6e220c83519ee816daaa69614c /src/plugins
parent79ea3282889451240ff6a7740a2f583ea4b4a6c5 (diff)
downloadweechat-335ab22a553cc47b1b2acb95c3899e4bcea7ac36.zip
xfer: add check on filename2 allocation
Now string_expand_home() can return NULL if the HOME environment variable it not set, so this commit adds an extra check on the variable "filename2" before using it.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/xfer/xfer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/xfer/xfer.c b/src/plugins/xfer/xfer.c
index 7ffd7cf5b..5e3a054ac 100644
--- a/src/plugins/xfer/xfer.c
+++ b/src/plugins/xfer/xfer.c
@@ -1147,6 +1147,14 @@ xfer_add_cb (const void *pointer, void *data,
free (path);
}
#endif /* _WIN32 */
+ if (!filename2)
+ {
+ weechat_printf (NULL,
+ _("%s%s: not enough memory (%s)"),
+ weechat_prefix ("error"), XFER_PLUGIN_NAME,
+ "xfer_add, filename2");
+ goto error;
+ }
/* check if file exists */
if (stat (filename2, &st) == -1)
{