diff options
-rwxr-xr-x | bin/common/srtool_common.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/common/srtool_common.py b/bin/common/srtool_common.py index 66e980af..13b5893d 100755 --- a/bin/common/srtool_common.py +++ b/bin/common/srtool_common.py @@ -165,6 +165,8 @@ def init_package_keywords(filename): recommends = [] +import traceback + #generates importance score based on key-words in description of CVE, higher indicates more important def compute_recommends(cve): recommend = 0 @@ -200,6 +202,8 @@ def compute_recommends(cve): total += weight except Exception as e: print("ERROR:%s|%s|%s" % (key, description,e)) + traceback.print_stack() + exit(1) # set filter maximums if total < -3: @@ -248,7 +252,7 @@ def attach_packages(cur, cve, recommend_list): # Create Package if verbose: print("INSERTING PACKAGE for %s,%s" % (cve[ORM.CVE_NAME],pkg_name)) sql = '''INSERT INTO orm_package (mode, name, realname, invalidname, weight, cve_count, vulnerability_count, investigation_count,defect_count ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)''' - cur.execute(sql, (mode, pkg_name, pkg_name, '', 1 if FOR==mode else -1),0,0,0,0) + cur.execute(sql, (mode, pkg_name, pkg_name, '', 1 if FOR==mode else -1,0,0,0,0,)) pkg_id = cur.lastrowid # Also create Package2CVE sql = "SELECT * FROM orm_packagetocve where package_id = '%s' AND cve_id = '%s';" % (pkg_id,cve_id) |