Fix erroneous DCC file names and crash upon aborting
This commit is contained in:
parent
4724443124
commit
d142c74c15
|
@ -1829,11 +1829,9 @@ dcc_send (struct session *sess, char *to, char *file, int maxcps, int passive)
|
||||||
dcc->fp = g_open (file, OFLAGS | O_RDONLY, 0);
|
dcc->fp = g_open (file, OFLAGS | O_RDONLY, 0);
|
||||||
if (dcc->fp != -1)
|
if (dcc->fp != -1)
|
||||||
{
|
{
|
||||||
g_free (file);
|
|
||||||
if (passive || dcc_listen_init (dcc, sess))
|
if (passive || dcc_listen_init (dcc, sess))
|
||||||
{
|
{
|
||||||
char havespaces = 0;
|
char havespaces = 0;
|
||||||
file = dcc->file;
|
|
||||||
while (*file)
|
while (*file)
|
||||||
{
|
{
|
||||||
if (*file == ' ')
|
if (*file == ' ')
|
||||||
|
@ -1861,7 +1859,8 @@ dcc_send (struct session *sess, char *to, char *file, int maxcps, int passive)
|
||||||
"DCC SEND %s 199 0 %" DCC_SFMT " %d",
|
"DCC SEND %s 199 0 %" DCC_SFMT " %d",
|
||||||
file_part (dcc->file),
|
file_part (dcc->file),
|
||||||
dcc->size, dcc->pasvid);
|
dcc->size, dcc->pasvid);
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
snprintf (outbuf, sizeof (outbuf), (havespaces) ?
|
snprintf (outbuf, sizeof (outbuf), (havespaces) ?
|
||||||
"DCC SEND \"%s\" %u %d %"DCC_SFMT :
|
"DCC SEND \"%s\" %u %d %"DCC_SFMT :
|
||||||
|
@ -1883,7 +1882,7 @@ dcc_send (struct session *sess, char *to, char *file, int maxcps, int passive)
|
||||||
PrintTextf (sess, _("Cannot access %s\n"), dcc->file);
|
PrintTextf (sess, _("Cannot access %s\n"), dcc->file);
|
||||||
PrintTextf (sess, "%s %d: %s\n", _("Error"), errno, errorstring (errno));
|
PrintTextf (sess, "%s %d: %s\n", _("Error"), errno, errorstring (errno));
|
||||||
xit:
|
xit:
|
||||||
dcc_close (dcc, 0, TRUE);
|
dcc_close (dcc, 0, TRUE); /* dcc_close will free dcc->file */
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct DCC *
|
static struct DCC *
|
||||||
|
|
Loading…
Reference in New Issue