[Dovecot] Segmentation fault in dovecot-sieve-1.1.2 + dovecot-1.1.beta13

Ron Avriel ravriel_1 at yahoo.com
Mon Dec 31 11:11:51 EET 2007



Hi,


 


dovecot-sieve-1.1.2 + dovecot-1.1.beta13 segfaults with
the following sieve filter:


---


require ["imapflags"];


if header :contains "subject"
["test"]


{


 addflag
"$testflag";


}


---


 


when a message with a subject containing "test"
is delivered via dovecot lda.


 


The fault backtrace is:


 


(gdb) run


Starting program: /usr/local/libexec/dovecot/deliver -d
load1 at virt1.cti2.com < bad.txt


 


Program received signal SIGSEGV, Segmentation fault.


get_flags (sieve_flags=0xbfe7e438, flags_r=0xbfe7dee4,
keywords_r=0x2)


    at
/root/dovecot-1.1.beta13/src/lib/array.h:145


145            
*count_r = array->buffer->used / array->element_size;


(gdb) bt


#0  get_flags
(sieve_flags=0xbfe7e438, flags_r=0xbfe7dee4, keywords_r=0x2)


    at
/root/dovecot-1.1.beta13/src/lib/array.h:145


#1  0x00f68744 in
sieve_keep (ac=0x2, ic=0x0, sc=0xbfe7f4e0, mc=0xbfe7f480,


   
errmsg=0xbfe7e3f0) at sieve-cmu.c:561


#2  0x00f779a5 in
do_sieve_error (ret=0, interp=0x92dbf18, script_context=0xbfe7f4e0,


   
message_context=0xbfe7f480, imapflags=0xbfe7e438, actions=0x92e42d8,
notify_list=0x0,


    lastaction=8,
implicit_keep=1, actions_string=0xbfe7e440 "Action(s) taken:\n",


    errmsg=0x0) at
script.c:627


#3  0x00f780d8 in
sieve_execute_bytecode (exe=0x92dcc58, interp=0x92dbf18,


   
script_context=0xbfe7f4e0, message_context=0xbfe7f480) at script.c:824


#4  0x00f69809 in
cmu_sieve_run (namespaces=0x92d5c70, storage_r=0xbfe7f6ac,


    mail=0x92de358,
script_path=0x92d3c82 "/usr/local/etc/sieve_global.txt",


   
destaddr=0xbff3fbb9 "load1 at virt1.cti2.com", username=0x92d4b05
"load1 at virt1.cti2.com",


   
mailbox=0x80d0367 "INBOX") at sieve-cmu.c:971


#5  0x00f67752 in
cmusieve_deliver_mail (namespaces=0x92d5c70, storage_r=0xbfe7f6ac,


    mail=0x92de358,
destaddr=0xbff3fbb9 "load1 at virt1.cti2.com", mailbox=0x80d0367
"INBOX")


    at
cmusieve-plugin.c:76


#6  0x0805aa4f in
main (argc=3, argv=0xbfe7f794) at deliver.c:940


(gdb)


 


I managed to fix the problem with this patch to
sieve-cmu.c:


 


--- sieve-cmu.c.orig   
2007-12-31 10:21:54.000000000 +0200


+++ sieve-cmu.c 2007-12-31 10:24:18.000000000 +0200


@@ -495,6 +495,7 @@


       
ARRAY_DEFINE(keywords, const char *);


         const char
*name;


        int i;


+        unsigned
int count;


 


        *flags_r = 0;


 


@@ -524,7 +525,7 @@


       
array_append(&keywords, &name, 1);


 


        *keywords_r
= array_count(&keywords) == 1 ? NULL :


-              
array_get(&keywords, 0);


+              
array_get(&keywords, &count);


 }


 


 static int
sieve_fileinto(void *ac,


 


 


 


BTW, dovecot-sieve-1.0.2 + dovecot-1.0.9 work OK for the
above.


 


Happy New Year and thanks for a great product,


Ron


 






      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs



More information about the dovecot mailing list