SVN: security/cve_reader.py

shadzik shadzik at pld-linux.org
Mon Jun 2 23:33:46 CEST 2008


Author: shadzik
Date: Mon Jun  2 23:33:46 2008
New Revision: 9790

Modified:
   security/cve_reader.py
Log:
- some formal fixes (thx wpk)
- add debug points


Modified: security/cve_reader.py
==============================================================================
--- security/cve_reader.py	(original)
+++ security/cve_reader.py	Mon Jun  2 23:33:46 2008
@@ -113,16 +113,19 @@
 							
 							# Good, found CVE entries. Extract them!
 							cve_list = re.findall("(CVE-[0-9]{4}-[0-9]{4}|CVE-[0-9]{4}-\{[0-9\,]+\})(?!\.diff|\.patch)", lines[i+cvslog])
-							for iter in range(len(cve_list)):
-								if re.match('.*\{', cve_list[iter]):
-									cvemultiarray = cve_list[iter].split("-{")
+							for cve_elem in range(len(cve_list)):
+								if re.match('.*\{', cve_list[cve_elem]):
+									print "Found multi cve"
+									cvemultiarray = cve_list[cve_elem].split("-{")
 									prefix = cvemultiarray[0]
 									cvemultiarray[1] = cvemultiarray[1].strip("}")
 									postfixarray = cvemultiarray[1].split(",")
-									for i in range(len(postfixarray)):
-										cve.append("%s-%s" % (prefix, postfixarray[i]))
-								else:
-									cve.append(cve_list[iter])
+									for postfix in postfixarray:
+										print("Appending to cve %s-%s" % (prefix, postfix))
+										cve.append("%s-%s" % (prefix, postfix))
+									break
+								print("appending regular cve %s" % (cve_list[cve_elem]))
+								cve.append(cve_list[cve_elem])
 				
 				cvslog = cvslog + 1
 			


More information about the pld-cvs-commit mailing list