You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2024/04/04 18:13:40 UTC

(httpd-site) 01/04: give hint about failing file

This is an automated email from the ASF dual-hosted git repository.

covener pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/httpd-site.git

commit 258590c0553afd3f19b546ac6993e34944975b9a
Author: Eric Covener <ec...@us.ibm.com>
AuthorDate: Thu Apr 4 14:06:30 2024 -0400

    give hint about failing file
---
 content/security/cvejsontohtml.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/content/security/cvejsontohtml.py b/content/security/cvejsontohtml.py
index 46265d0..23883a1 100644
--- a/content/security/cvejsontohtml.py
+++ b/content/security/cvejsontohtml.py
@@ -3,6 +3,7 @@ import os
 import re
 import xml.sax.saxutils as saxutils 
 import sys
+import traceback
 from optparse import OptionParser
 parser = OptionParser()
  
@@ -70,13 +71,16 @@ for k,v in sorted(entries.items(), key=lambda s: [int(u) if u.isdigit() else 999
         e['cveid'] = cve["id"]
         data_version = cve.get("dataVersion", DEFAULT_CVE_DATA_VERSION)
         if data_version == "5.0":
-            e['impact'] = cve["containers"]["cna"]["metrics"][0]["other"]["content"]["text"]
-            e['title'] = cve["containers"]["cna"]["title"]
-            e['desc'] = cve["containers"]["cna"]["descriptions"][0]["value"]
-            e['credit'] = []
-            if ("credits" in cve["containers"]["cna"]):
-                for credit in cve["containers"]["cna"]["credits"]:
-                    e['credit'].append(credit["type"]+": "+credit["value"])
+            try:
+                e['impact'] = cve["containers"]["cna"]["metrics"][0]["other"]["content"]["text"]
+                e['title'] = cve["containers"]["cna"]["title"]
+                e['desc'] = cve["containers"]["cna"]["descriptions"][0]["value"]
+                e['credit'] = []
+                if ("credits" in cve["containers"]["cna"]):
+                    for credit in cve["containers"]["cna"]["credits"]:
+                        e['credit'].append(credit["type"]+": "+credit["value"])
+            except Exception as err:
+                sys.stderr.write("Missing data in " + cve["_filename"] + ": " + traceback.format_exc().replace('\n','\n    '))
             affects = []
             product = cve["containers"]["cna"]["affected"][0]
             productname = product['product']