Skip to content

Commit fc2634f

Browse files
authored
updates gosec parser - fixes protection on cwe_id conversion
- Added a protection on the cwe_id assignment via the integer convertion from string
1 parent 54a118f commit fc2634f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dojo/tools/gosec/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def get_findings(self, filename, test):
4747
if cwe_data:
4848
cwe_id_str = cwe_data.get("id")
4949
if cwe_id_str:
50-
cwe_id = int(cwe_id_str)
50+
cwe_id = int(cwe_id_str) if cwe_id_str.isdigit() else None
5151
cwe_url = cwe_data.get("url")
5252
if cwe_url:
5353
references = cwe_url

0 commit comments

Comments
 (0)