From: hno <> Date: Tue, 18 Sep 2001 19:55:00 +0000 (+0000) Subject: Fix for a segfault in ftp.c when only creating directories X-Git-Tag: SQUID_3_0_PRE1~1396 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=0dfb298f2f28de5bf340c2d9f66d272518810c5d;p=thirdparty%2Fsquid.git Fix for a segfault in ftp.c when only creating directories (PUT with a trailing slash and no filename, content-length == 0) --- diff --git a/src/ftp.cc b/src/ftp.cc index 22b8c187f5..7741f0e3a2 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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);