[PATCH 2/3] report-vuln: don't fail if description_from_list return None
If no description was found None is returned. This fixes
Traceback (most recent call last):
File "bin/report-vuln", line 237, in <module>
main()
File "bin/report-vuln", line 234, in main
gen_text(pkg, cve, affected=args.affected, blanks=args.blanks, severity=args.severity, cc=args.cc, cclist=args.cclist, src=args.src)
File "bin/report-vuln", line 156, in gen_text
print get_cve(cve)
File "bin/report-vuln", line 114, in get_cve
return ret + '\n'
TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
in case of a yet unknown CVE.
---
O.k. to apply?
bin/report-vuln | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/report-vuln b/bin/report-vuln
index 3e176e182f..a20f6ae764 100755
--- a/bin/report-vuln
+++ b/bin/report-vuln
@@ -108,7 +108,7 @@ def get_cve(id):
if ret == '':
ret = description_from_list(id)
- if ret == '':
+ if not ret:
ret = 'No description was found (try on a search engine)'
return ret + '\n'
--
2.15.0
Reply to: