prelude-manager/master: Prevent infinite loop

[email protected] Fri, 6 Aug 2010 11:58:34 +0200 (CEST)
Newsgroups gmane.comp.security.ids.prelude.cvs
Message-ID <[email protected]>
commit f13f3cf321abf762e589877ac1601de4e89da4b7
Author: Yoann Vandoorselaere <[email protected]>
Date:   Mon Aug 2 17:37:52 2010 +0200

    Prevent infinite loop
    
    An infinite loop was possible on insertion of an event in the processing
    queue in case the event len was higher than the 'on disk threshold' value.
    Closes #385.
    
    Thanks Friedrich Delgado <[email protected]> for reporting the problem,
    and the useful debug information!


========================================

 src/bufpool.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

========================================

diff --git a/src/bufpool.c b/src/bufpool.c
index f6ce180..89f747a 100644
--- a/src/bufpool.c
+++ b/src/bufpool.c
@@ -224,7 +224,7 @@ int bufpool_add_message(bufpool_t *bp, prelude_msg_t *msg)
 
         while ( get_total_mem() + len >= on_disk_threshold ) {
                 evicted = evict_from_memory();
-                if ( evicted == bp )
+                if ( evicted == NULL || evicted == bp )
                         break;
         }
 
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-technologies.com/mailman/listinfo/prelude-cvslog