fetchmail-friends
[Top] [All Lists]

[fetchmail] [PATCH] Re: Something unchecked in fetchmail 6.2.0?

2002-12-27 00:11:15
Quoting from Frank Laurijssens's mail on Thu, Dec 26, 2002 at 04:11:31PM +0100:
Since I upgraded from 6.1.0 to 6.2.0, I'm getting (at irregular intervals) 
authentication errors like the one I attached. It happens with the host 
mentioned as well as the other hosts in my .fetchmailrc. 

Yes, the authentication errors were not being sent earlier. This was
fixed recently.

You should check your logs for authentication failures. You may run
'fetchmail -v' and check the output.

Besides the error, it looks like the memory area that's being used for the 
creation of the notification message is being overwritten.

There is a bug in sending of the warning messages. This patch should
fix this:

====================================================================
diff -Naur fetchmail-6.2.0.orig/sink.c fetchmail-6.2.0/sink.c
--- fetchmail-6.2.0.orig/sink.c Fri Dec 13 10:39:08 2002
+++ fetchmail-6.2.0/sink.c      Fri Dec 27 11:58:11 2002
@@ -1463,7 +1463,7 @@
 #endif
 /* format and ship a warning message line by mail */
 {
-    char       buf[POPBUFSIZE];
+    char       buf[MSGBUFSIZE+4];
     va_list ap;
 
     /*
@@ -1489,6 +1489,11 @@
 #else
     strcat(buf, "\r\n");
 #endif /* HAVE_SNPRINTF */
+
+    /* guard against very long lines */
+    buf[MSGBUFSIZE+1] = '\r';
+    buf[MSGBUFSIZE+2] = '\n';
+    buf[MSGBUFSIZE+3] = '\0';
 
     stuffline(ctl, buf);
 }
====================================================================

-- 
Sunil Shetye.

<Prev in Thread] Current Thread [Next in Thread>