diff options
author | 2009-12-04 14:35:12 +0100 | |
---|---|---|
committer | 2009-12-04 14:35:12 +0100 | |
commit | b77318df1b958b7dd4744ae3f22f12c13143f975 (patch) | |
tree | f816d51126bc27c50fd1588151ce1e722890b7ee | |
parent | Change CLI output (diff) | |
download | kernel-check-b77318df1b958b7dd4744ae3f22f12c13143f975.tar.gz kernel-check-b77318df1b958b7dd4744ae3f22f12c13143f975.tar.bz2 kernel-check-b77318df1b958b7dd4744ae3f22f12c13143f975.zip |
Fix two exceptions
-rwxr-xr-x | pym/kernelcheck/kernelcheck.py | 5 | ||||
-rw-r--r-- | pym/kernelcheck/lib/kernellib.py | 7 |
2 files changed, 9 insertions, 3 deletions
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 |