]> sjero.net Git - wget/commitdiff
[svn] Fixed segfault if response text is missing
authormtortonesi <devnull@localhost>
Tue, 9 Jan 2007 14:37:03 +0000 (06:37 -0800)
committermtortonesi <devnull@localhost>
Tue, 9 Jan 2007 14:37:03 +0000 (06:37 -0800)
src/ChangeLog
src/ftp-basic.c

index 5f13717130f2d8456a8f1bf08d0f9128ae70ba72..76f88a1235d76e2ca826d0fad9253029cb2a501c 100644 (file)
@@ -1,3 +1,7 @@
+2007-01-09  Steven M. Schweda  <sms@antinode.org>
+
+       * ftp-basic.c (ftp_syst): Fixed segfault if response text is missing.
+
 2006-12-29  Gisle Vanem  <giva@bgnett.no>
 
        * mswindows.c: Avoid a warning if 'ws_hangup()' is unused.
index 851f506884b9a0817770151af7898e7c595b1434..3a714078aaeb7d51b32925aa56953de73518e510 100644 (file)
@@ -1,5 +1,5 @@
 /* Basic FTP routines.
-   Copyright (C) 1996-2006 Free Software Foundation, Inc.
+   Copyright (C) 1996-2007 Free Software Foundation, Inc.
 
 This file is part of GNU Wget.
 
@@ -1038,7 +1038,9 @@ ftp_syst (int csock, enum stype *server_type)
      first word of the server response)?  */
   request = strtok (NULL, " ");
 
-  if (!strcasecmp (request, "VMS"))
+  if (request == NULL)
+    *server_type = ST_OTHER;
+  else if (!strcasecmp (request, "VMS"))
     *server_type = ST_VMS;
   else if (!strcasecmp (request, "UNIX"))
     *server_type = ST_UNIX;