1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 14:26:39 +02:00

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.
This commit is contained in:
Sébastien Helleu
2016-10-30 07:07:29 +01:00
parent 79ea328288
commit 335ab22a55
+8
View File
@@ -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)
{