From b77318df1b958b7dd4744ae3f22f12c13143f975 Mon Sep 17 00:00:00 2001 From: Bjoern Tropf Date: Fri, 4 Dec 2009 14:35:12 +0100 Subject: Fix two exceptions --- pym/kernelcheck/kernelcheck.py | 5 ++++- pym/kernelcheck/lib/kernellib.py | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'pym') diff --git a/pym/kernelcheck/kernelcheck.py b/pym/kernelcheck/kernelcheck.py index a9d6e9f..5eac6b1 100755 --- a/pym/kernelcheck/kernelcheck.py +++ b/pym/kernelcheck/kernelcheck.py @@ -57,7 +57,10 @@ def main(argv): if lib.REGEX['argument'].match(arg): if 'cve' in arg.lower(): vul = lib.find_cve(arg, lib.DIR['out']) - print_bug(vul.bugid) + if not vul: + print_bug(arg) #FIXME + else: + print_bug(vul.bugid) else: print_bug(arg) return diff --git a/pym/kernelcheck/lib/kernellib.py b/pym/kernelcheck/lib/kernellib.py index 6aa3270..eb71b2b 100644 --- a/pym/kernelcheck/lib/kernellib.py +++ b/pym/kernelcheck/lib/kernellib.py @@ -468,8 +468,11 @@ def eval_cve_files(directory, kernel, arch, spin=None): cvss_score += float(cve.score) else: evaluation.unaffected.append(item) - - evaluation.avg_cvss = cvss_score / cve_amount + + if cve_amount is 0: + evaluation.avg_cvss = 0 + else: + evaluation.avg_cvss = cvss_score / cve_amount return evaluation -- cgit v1.2.3-65-gdbad