]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix for a segfault in ftp.c when only creating directories
authorhno <>
Tue, 18 Sep 2001 19:55:00 +0000 (19:55 +0000)
committerhno <>
Tue, 18 Sep 2001 19:55:00 +0000 (19:55 +0000)
(PUT with a trailing slash and no filename, content-length == 0)

src/ftp.cc

index 22b8c187f50d1dabe35bac7364e66b8d36c5700f..7741f0e3a27e164d4e42289f8333dee9f3360473 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.310 2001/04/14 00:25:18 hno Exp $
+ * $Id: ftp.cc,v 1.311 2001/09/18 13:55:00 hno Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -2458,8 +2458,10 @@ ftpSendReply(FtpStateData * ftpState)
        err->ftp.request = xstrdup(ftpState->ctrl.last_command);
     if (ftpState->old_reply)
        err->ftp.reply = xstrdup(ftpState->old_reply);
-    else
+    else if (ftpState->ctrl.last_reply)
        err->ftp.reply = xstrdup(ftpState->ctrl.last_reply);
+    else
+       err->ftp.reply = xstrdup("");
     errorAppendEntry(ftpState->entry, err);
     storeBufferFlush(ftpState->entry);
     ftpSendQuit(ftpState);