Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-updates-src > by-pkgid > 66cf70cb4b27fe034994d790dba13f43 > files > 10

proftpd-1.3.5e-4.2.mga7.src.rpm

Index: proftpd-dfsg-1.3.5e+r1.3.5/src/main.c
===================================================================
--- proftpd-dfsg-1.3.5e+r1.3.5.orig/src/main.c	2019-10-23 15:21:34.596319577 +0200
+++ proftpd-dfsg-1.3.5e+r1.3.5/src/main.c	2019-10-23 15:22:10.400320722 +0200
@@ -483,6 +483,7 @@
   static char *cmd_buf = NULL;
   char *cp;
   size_t cmd_buflen;
+  unsigned int too_large_count = 0;
 
   if (res == NULL) {
     errno = EINVAL;
@@ -507,8 +508,15 @@
 
       if (errno == E2BIG) {
         /* The client sent a too-long command which was ignored; give
-         * them another chance?
+         * them a few more chances, with minor delays?
          */
+        too_large_count++;
+        pr_timer_usleep(250 * 1000);
+
+        if (too_large_count > 3) {
+          return -1;
+        }
+
         continue;
       }
 
Index: proftpd-dfsg-1.3.5e+r1.3.5/src/netio.c
===================================================================
--- proftpd-dfsg-1.3.5e+r1.3.5.orig/src/netio.c	2019-10-23 15:21:34.596319577 +0200
+++ proftpd-dfsg-1.3.5e+r1.3.5/src/netio.c	2019-10-23 15:21:34.592319577 +0200
@@ -1037,6 +1037,7 @@
       }
 
       nstrm->strm_errno = 0;
+      errno = EOF;
       break;
     }