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

Re: [sup-devel] sup-server revisited



* William Morgan <wmorgan-sup@masanjin.net> [Do Mär 03 20:17:36 +0100 2011]
> Reformatted excerpts from Gregor Hoffleit's message of 2011-03-03:
> > William, I was able to isolate my problem: For me, heliotrope-add hangs
> > for messages with more than 32768 content lines.
> 
> Crazy! I will take a look. Thanks for the good debugging.

William, I noticed that heliotrope still has a problem with mails with
my mail with more than 32768 lines of content.

The source of this problem is in whistlepig's tokenizer. I'm hurt by an
overflow in posarray->next and posarray->size, which are defined as
uint16_t. I was able to fix my problem by defining these to uint32_t:


commit 42dbc087260074513af22078b77e65b91d3318d9
Author: Gregor Hoffleit <gregor@hoffleit.de>
Date:   Fri Apr 15 12:19:10 2011 +0200

    Bugfix: uint16_t is too small for posarray->size and posarray->next
    
    Change the type of posarray->size and posarray->next from uint16_t
    to uint32_t. 16 bits are not enough to hold really large messages.

diff --git a/entry.h b/entry.h
index 9799e15..56673a0 100644
--- a/entry.h
+++ b/entry.h
@@ -15,8 +15,8 @@
 #include "khash.h"
 
 typedef struct posarray {
-  uint16_t size;
-  uint16_t next;
+  uint32_t size;
+  uint32_t next;
   pos_t* data;
 } posarray;
 


Regards,
    Gregor Hoffleit
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel