prelude-correlator/master: Fix correlator exception with empty list

[email protected] Tue, 16 Mar 2010 09:20:40 +0100 (CET)
Newsgroups gmane.comp.security.ids.prelude.cvs
Message-ID <[email protected]>
commit 82465fd06f62b12274cfd92ae23ddf1bd8e61417
Author: F. Yhuel <[email protected]>
Date:   Tue Mar 16 00:31:44 2010 +0100

    Fix correlator exception with empty list
    
    With recent versions of libprelude, the IDMEF class Set() method
    properly handle empty lists, but raises an exception on None input value.
    Therefore, the three lines removed in this patch, which were casting
    empty list into None, used to trigger a prelude-correlator exception,
    when prelude-correlator was receiving IDMEF alerts without sources or
    targets.
    
    Signed-off-by: Yoann Vandoorselaere <[email protected]>


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

 PreludeCorrelator/idmef.py |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

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

diff --git a/PreludeCorrelator/idmef.py b/PreludeCorrelator/idmef.py
index c669a83..b7d96cb 100644
--- a/PreludeCorrelator/idmef.py
+++ b/PreludeCorrelator/idmef.py
@@ -74,10 +74,6 @@ class IDMEF(PreludeEasy.IDMEF):
                         if cur and value.Match(cur, PreludeEasy.IDMEFCriterion.OPERATOR_EQUAL) > 0:
                                 return
 
-                elif type(value) is tuple or type(value) is list:
-                        if not value:
-                                value = None
-
                 PreludeEasy.IDMEF.Set(self, path, value)
 
         def _match(self, path, needle):
_______________________________________________
Prelude-cvslog site list
[email protected]
http://lists.prelude-technologies.com/mailman/listinfo/prelude-cvslog