]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #853: SIGSEGV on FTP PUT
authorhno <>
Sun, 4 Apr 2004 20:47:06 +0000 (20:47 +0000)
committerhno <>
Sun, 4 Apr 2004 20:47:06 +0000 (20:47 +0000)
If a FTP PUT request is aborted while Squid is writing data to the server
then Squid may abort with a segmentation fault.

src/ftp.cc

index a15fbe72a7ddf136b04514a2a7f0a01ac5c4c060..8c8e8233327b66000c0d9ce65ce3f271191e58e8 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.355 2003/09/07 16:53:37 hno Exp $
+ * $Id: ftp.cc,v 1.356 2004/04/04 14:47:06 hno Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -2717,6 +2717,9 @@ ftpDataWriteCallback(int fd, char *buf, size_t size, comm_err_t err, int xerrno,
 {
     FtpStateData *ftpState = (FtpStateData *) data;
 
+    if (err == COMM_ERR_CLOSING)
+        return;
+
     if (!err) {
         /* Shedule the rest of the request */
         clientReadBody(ftpState->request, ftpState->data.buf, ftpState->data.size, ftpRequestBody, ftpState);