bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-inetutils] inetutils 1.8: Crash of the FTP server in debug mode


From: Rachid Koucha
Subject: [bug-inetutils] inetutils 1.8: Crash of the FTP server in debug mode
Date: Fri, 04 Mar 2011 09:37:56 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8

Hi,

When we run ftpd in debug mode (option --debug on the command line), the server crashes upon incoming connections. The bug comes from the functions reply() and lreply() in the file ftpd/ftpd.c: The functions do not "reset" the "va_list" before calling syslog(). So, the latter gets the end of the list of arguments. This triggers a crash on my PowerPc based target !


Please apply the following patch:

diff -Naurp OLD/ftpd/ftpd.c NEW/ftpd/ftpd.c
--- OLD/ftpd/ftpd.c	2011-03-03 19:07:26.449998496 +0100
+++ NEW/ftpd/ftpd.c	2011-03-03 19:09:12.696935892 +0100
@@ -1483,10 +1483,13 @@ reply (int n, const char *fmt, ...)
   vprintf (fmt, ap);
   printf ("\r\n");
   fflush (stdout);
+  va_end(ap);
   if (debug)
     {
       syslog (LOG_DEBUG, "<--- %d ", n);
+      va_start (ap, fmt);
       vsyslog (LOG_DEBUG, fmt, ap);
+      va_end(ap);
     }
 }
 
@@ -1499,10 +1502,13 @@ lreply (int n, const char *fmt, ...)
   vprintf (fmt, ap);
   printf ("\r\n");
   fflush (stdout);
+  va_end(ap);
   if (debug)
     {
       syslog (LOG_DEBUG, "<--- %d- ", n);
+      va_start (ap, fmt);
       vsyslog (LOG_DEBUG, fmt, ap);
+      va_end(ap);
     }
 }
 


Regards,

--
Rachid Koucha


reply via email to

[Prev in Thread] Current Thread [Next in Thread]