]> git.ipfire.org Git - thirdparty/squid.git/commit
FEAT response with excessive whitespace
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 23 Jan 2014 18:10:31 +0000 (20:10 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Thu, 23 Jan 2014 18:10:31 +0000 (20:10 +0200)
commitcb03c661889952a82565097fc8e585c5dd629892
tree5b390f9de2b0fc67a76636ce5fde09d58c2f8280
parenta37ec7fa9e6d67647727e3e459cadf5aa5fcecb3
FEAT response with excessive whitespace

Some broken Microsoft FTP servers seem to be sending the following
response to the FEAT command:

211-FEAT
....SIZE
....MDTM
211 END

A single dot above represents a single space character, so instead of
one space character they send 4 (four) space characters at the beginning
of the internal FEAT lines.

When this happens, the FTP client who sent the FEAT request to Squid
gets nothing; its connection hangs.

The problem is inside FtpHandleFeatReply function while parses the commands
list. Arguments corresponding to an emty string passes to String::substr call
(e->value.substr(beg-raw, end-raw) call) causing failure to a Must clause.

This patch:
 - fixes and adds checks to avoid processing lines which does not include a
   command.
 - try to detect extra spaces before commands
 - try to add the same number of spaces before commands inserted by squid
   to FEAT commands list (EPSV and EPRT commands)
src/client_side.cc