From: Kurt De Grave

> I prefer not to run unsigned software whenever possible.

   In that case, I think that you're doomed.  (Unless you trust yourself
to change the code, that is.)

> However, I have a SUSE 10.1 system around, with wget 1.10.2, and it
> segfaults as well.

   Ok.

> >    To which type of FTP server are you talking?
> I believe it is a Windows 2000 Server. It is definitely Windows.

   This seems to be the key.

> ==> SYST ...
> --> SYST
> 
> 215

> Lukemftp responds to SYST with:
> 215

   The wget code was expecting a longer response than that.  For
example (antinode.org):
      200 VMS OpenVMS V7.3 on node alp.antinode.org.
or (ftp.hp.com):
      215 UNIX Type: L8
That is, a 2xx code followed by some text describing the FTP server
type.

   A quick look at src/ftp-basic.c suggests that the problem may lie
here:

[...]
  /* Skip the number (215, but 200 (!!!) in case of VMS) */
  strtok (respline, " ");

  /* Which system type has been reported (we are interested just in the
     first word of the server response)?  */
  request = strtok (NULL, " ");

  if (!strcasecmp (request, "VMS"))
    *server_type = ST_VMS;
[...]

   With no text after the "215" in this FTP server's response, "request"
is probably NULL, causing the first strcasecmp() to explode.  It might
work a little better if it looked like this:

[...]
  /* Skip the number (215, but 200 (!!!) in case of VMS) */
  strtok (respline, " ");

  /* Which system type has been reported (we are interested just in the
     first word of the server response)?  */
  request = strtok (NULL, " ");

  if (request == NULL)
    *server_type = ST_OTHER;
  else if (!strcasecmp (request, "VMS"))
    *server_type = ST_VMS;
[...]

   This code doesn't seem to be any different/better in wget
"1.11-alpha-1", so it may not be any different/better yet in the main
development code, either.

   Of course, because this FTP server doesn't actually identify itself
as anything in particular, you can still expect to see a complaint from
wget like:

      Unsupported listing type, trying Unix listing parser.

And if the directory listing format is _not_ UNIX-like, then the whole
thing may fail with confusing symptoms.

------------------------------------------------------------------------

   Steven M. Schweda               [EMAIL PROTECTED]
   382 South Warwick Street        (+1) 651-699-9818
   Saint Paul  MN  55105-2547

Reply via email to