Update patch set 1

Patch Set 1:

(1 comment)

Patch-set: 1
Attention: {"person_ident":"Gerrit User 32753 \u003c32753@4a232e18-c5a9-48ee-94c0-e04e7cca6543\u003e","operation":"ADD","reason":"\u003cGERRIT_ACCOUNT_28739\u003e replied on the change"}
Attention: {"person_ident":"Gerrit User 28739 \u003c28739@4a232e18-c5a9-48ee-94c0-e04e7cca6543\u003e","operation":"REMOVE","reason":"\u003cGERRIT_ACCOUNT_28739\u003e replied on the change"}
This commit is contained in:
Gerrit User 28739 2024-04-08 14:06:48 +00:00 committed by Gerrit Code Review
parent 1b54204827
commit deaec51913
1 changed files with 23 additions and 0 deletions

View File

@ -1,5 +1,28 @@
{
"comments": [
{
"unresolved": true,
"key": {
"uuid": "f80f2164_9a200101",
"filename": "cve_support/cve_policy_filter.py",
"patchSetId": 1
},
"lineNbr": 251,
"author": {
"id": 28739
},
"writtenOn": "2024-04-08T14:06:48Z",
"side": 1,
"message": "The fact that it is named \"optional\" makes me think that instead of letting the absence of [\"optional\"][\"source\"] in one entry be a KeyError for the entire list, it might be better to keep searching the list. If there is no entry with value \"nvd@nist.gov\" then raise a KeyError.\n\nHowever, I did not find any examples in the dataset you shared with me:\n\n for k in data[\u0027scannedCves\u0027]:\n if \u0027nvd\u0027 not in data[\u0027scannedCves\u0027][k][\u0027cveContents\u0027].keys():\n continue\n missing\u003dFalse\n use_l\u003d{}\n for l in data[\u0027scannedCves\u0027][k][\u0027cveContents\u0027][\u0027nvd\u0027]:\n try:\n if l[\"optional\"][\"source\"] \u003d\u003d \"nvd@nist.gov\":\n if not use_l: \n use_l \u003d l\n else:\n print(\"Oops: two entries for nvd@nist.gov: %s\" % k)\n except KeyError:\n # ignore missing [\"optional\"][\"source\"]\n missing\u003dTrue\n pass\n if missing and use_l:\n print(\"CVE %s is example\" % k)\n\nResult of the above is empty. Please consider the above, but since I do not find an example in the dataset then also feel free to ignore the suggestion.",
"range": {
"startLine": 251,
"startChar": 89,
"endLine": 251,
"endChar": 111
},
"revId": "13039cef23df11684a4042049d5e2c90ab85bac5",
"serverId": "4a232e18-c5a9-48ee-94c0-e04e7cca6543"
},
{
"unresolved": true,
"key": {