Skip to content
Snippets Groups Projects
Commit 48b07e59 authored by deuce's avatar deuce
Browse files

Terminate IPv4 address before calling inet_addr(). On at least FreeBSD,

leaving the |<port>| in the string causes inet_addr() to fail, breaking
active FTP transfers.
parent 0da9de38
Branches
Tags
No related merge requests found
......@@ -2280,8 +2280,10 @@ static void ctrl_thread(void* arg)
char* np;
char* tp;
char* dp;
char* ap;
char* filespec;
char* mode="active";
char old_char;
char password[64];
char fname[MAX_PATH+1];
char qwkfile[MAX_PATH+1];
......@@ -2834,8 +2836,12 @@ static void ctrl_thread(void* arg)
FIND_CHAR(p,delim);
if(*p)
p++;
data_addr.in.sin_addr.s_addr=inet_addr(p);
ap = p;
FIND_CHAR(p,delim);
old_char = *p;
*p = 0;
data_addr.in.sin_addr.s_addr=inet_addr(ap);
*p = old_char;
if (*p)
p++;
data_port=atoi(p);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment