Opened 15 years ago

Last modified 15 years ago

#1387 closed Bug report

PWD Reply Parse: single-quoted paths are never parsed (bug)

Reported by: adrian_u Owned by:
Priority: normal Component: FileZilla Client
Keywords: Cc: adrian_u, Tim Kosse
Component version: Operating system type:
Operating system version:


There is a subtle bug in CControlSocket::ParsePwdReply():

int pos1 = reply.Find('"');
int pos2 = reply.Find('"', true);

if (pos1 == -1
pos1 >= pos2)


int pos1 = reply.Find('\);
int pos2 = reply.Find('\
, true);

The variables “pos1” and “pos2” are overridden within the inner “if” block so, after it completes its execution, the assigned values get lost and the original variables remain unchanged.

The fix is straightforward: simply remove the “int” keyword in the assignment of “pos1” and “pos2” within the “if” block.

Attachments (1)

log.txt (383 bytes ) - added by adrian_u 15 years ago.
Log file

Download all attachments as: .zip

Change History (5)

by adrian_u, 15 years ago

Attachment: log.txt added

Log file

comment:1 by Tim Kosse, 15 years ago

I'm tired of adding workarounds for broken servers that totally disregard the FTP specifications. It just blows up code size and causes slowdowns for proper servers.

To quote RFC 959:

upon successful completion of an MKD
command, the server should return a line of the form:



Essentially because the PWD command returns the same type of
information as the successful MKD command, the successful PWD
command uses the 257 reply code as well.

Just upgrade to a better server to fix this problem.

comment:2 by adrian_u, 15 years ago

That’s true. Thank you for your response.

Unfortunately the server is an old and horrible mainframe (Bull.)

comment:3 by Tim Kosse, 15 years ago

If it's old, even the cheapest modern computer should outperform it.

comment:4 by adrian_u, 15 years ago

You’re right again.

Unfortunately, we have too many Cobol programs in production and the migration process will take some years.

Note: See TracTickets for help on using tickets.