b597d0e35c0cc7c9180e56090c9cd3d9dc913586,sbin/db_mgmt_json.py,,process_cve_item,#,77

Before Change


                        else:
                            // If the cpe_match did not have any of the version start/end modifiers,
                            // add the CPE string as it is.
                            cve["vulnerable_product"].append(cpeuri["cpe23Uri"])
                            cve["vulnerable_configuration"].append(cpeuri["cpe23Uri"])
                    else:
                        cve["vulnerable_configuration"].append(cpeuri["cpe23Uri"])

            if "children" in cpe:
                for child in cpe["children"]:
                    if "cpe_match" in child:
                        for cpeuri in child["cpe_match"]:
                            if cpeuri["vulnerable"]:
                                query, version_info = get_cpe_info(cpeuri)
                                if query != {}:
                                    query["id"] = hashlib.sha1(cpeuri["cpe23Uri"].encode("utf-8") + version_info.encode("utf-8")).hexdigest()
                                    cpe_info = db.getCPEVersionInformation(query)

                                    if cpe_info:
                                        if cpe_info["cpe_name"]:
                                            for vulnerable_version in cpe_info["cpe_name"]:
                                                cve["vulnerable_product"].append(vulnerable_version["cpe23Uri"])
                                                cve["vulnerable_configuration"].append(vulnerable_version["cpe23Uri"])
                                        else:
                                            cve["vulnerable_product"].append(cpeuri["cpe23Uri"])
                                            cve["vulnerable_configuration"].append(cpeuri["cpe23Uri"])
                                else:
                                    // If the cpe_match did not have any of the version start/end modifiers,
                                    // add the CPE string as it is.
                                    cve["vulnerable_product"].append(cpeuri["cpe23Uri"])

After Change


                        else:
                            // If the cpe_match did not have any of the version start/end modifiers,
                            // add the CPE string as it is.
                            cve = add_if_missing(cve, "vulnerable_product", cpeuri["cpe23Uri"])
                            cve = add_if_missing(cve, "vulnerable_configuration", cpeuri["cpe23Uri"])
                    else:
                        cve = add_if_missing(cve, "vulnerable_configuration", cpeuri["cpe23Uri"])
            if "children" in cpe:
                for child in cpe["children"]:
                    if "cpe_match" in child:
                        for cpeuri in child["cpe_match"]:
                            if cpeuri["vulnerable"]:
                                query, version_info = get_cpe_info(cpeuri)
                                if query != {}:
                                    query["id"] = hashlib.sha1(cpeuri["cpe23Uri"].encode("utf-8") + version_info.encode("utf-8")).hexdigest()
                                    cpe_info = db.getCPEVersionInformation(query)
                                    if cpe_info:
                                        if cpe_info["cpe_name"]:
                                            for vulnerable_version in cpe_info["cpe_name"]:
                                                cve = add_if_missing(cve, "vulnerable_product", vulnerable_version["cpe23Uri"])
                                                cve = add_if_missing(cve, "vulnerable_configuration", vulnerable_version["cpe23Uri"])
                                        else:
                                            cve = add_if_missing(cve, "vulnerable_product", cpeuri["cpe23Uri"])
                                            cve = add_if_missing(cve, "vulnerable_configuration", cpeuri["cpe23Uri"])
                                else:
                                    // If the cpe_match did not have any of the version start/end modifiers,
                                    // add the CPE string as it is.
                                    cve = add_if_missing(cve, "vulnerable_product", cpeuri["cpe23Uri"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: cve-search/cve-search
Commit Name: b597d0e35c0cc7c9180e56090c9cd3d9dc913586
Time: 2019-11-07
Author: sami.kairajarvi@gmail.com
File Name: sbin/db_mgmt_json.py
Class Name:
Method Name: process_cve_item


Project Name: cve-search/cve-search
Commit Name: b597d0e35c0cc7c9180e56090c9cd3d9dc913586
Time: 2019-11-07
Author: sami.kairajarvi@gmail.com
File Name: sbin/db_mgmt_json.py
Class Name:
Method Name: process_cve_item