[Imapfilter-devel] segfault

Lefteris Chatzibarbas lefcha at users.sourceforge.net
Tue Oct 30 20:47:02 EET 2001


On Mon, Oct 29, 2001 at 08:34:24PM +0000, Gabor Z. Papp wrote:
> gzp at gzp1 ~/app/imapfilter $ ./imapfilter
> Connected to gzp1.gzp.
> No messages in mailbox INBOX.
> Connected to gzp1.gzp.
> 295 messages, 0 recent, 295 unseen, in mailbox INBOX.
> 209 messages listed.
> Segmentation fault
> ^^^^^^^^^^^^^^^^^^
> I can't catch up the debug output,
> 
> imapfilter 2>&1|tee debug
> 
> generates an empty file.
> 

A patch that fixes this bug is included as attachment.

After unpackaging the sources apply the patch with...

	cat patch-0.6.2 | patch -p0

... and compile and install as usual.

I will also release version 0.6.3 that will correct this problem.

Thanks for reporting this.

-------------- next part --------------
diff -rNu imapfilter-0.6.2/imapfilter.h imapfilter/imapfilter.h
--- imapfilter-0.6.2/imapfilter.h	Mon Oct  8 12:09:43 2001
+++ imapfilter/imapfilter.h	Tue Oct 30 20:35:18 2001
@@ -52,7 +52,7 @@
 #define HEADERS_BUF			8192
 
 /* Buffer size of search results. */
-#define SEARCH_MESSAGES_BUF		512
+#define SEARCH_MESSAGES_BUF		4096
 
 
 #define min(A, B)			((A) < (B) ? (A) : (B))
diff -rNu imapfilter-0.6.2/response.c imapfilter/response.c
--- imapfilter-0.6.2/response.c	Mon Oct  8 12:09:43 2001
+++ imapfilter/response.c	Tue Oct 30 20:35:13 2001
@@ -182,7 +182,7 @@
 
     if ((c = strcasestr(buf, "SEARCH "))) {
 	c += 7;
-	while (mesgs - m < 512 && (isdigit(*c) || *c == ' '))
+	while (m - mesgs < SEARCH_MESSAGES_BUF && (isdigit(*c) || *c == ' '))
 	    *(m++) = *(c++);
 	*m = 0;
     }


More information about the Imapfilter-devel mailing list