Is there anyway to print CWE ID (Common Weakness Enumeration) in Infer?
- Ngôn ngữ chính
- OCaml
- Star
- 15.7k
- Fork
- 2.1k
- Merge trung bình
- 19 giờ 36 phút
- Pull request đã merge (30 ngày)
- 13
Mô tả
- [ ] I am using `infer --0.17.0`.
- [ ] My OS is Ubuntu 18.04
- [ ] My command was `infer run -- g++ test.cpp`
My `test.cpp` file looks like this -
```c++
#include
using namespace std ;
int main()
{
int i ;
int j ;
i = 5;
j = 6;
j = i ;
int a[4];
a[6] = 0;
}
```
- [ ] The output looks like this -
```json
[{
"bug_type": "DEAD_STORE",
"qualifier": "The value written to &j (type int) is never used.",
"severity": "ERROR",
"line": 9,
"column": 5,
"procedure": "main",
"procedure_start_line": 4,
"file": "a.cpp",
"bug_trace": [{
"level": 0,
"filename": "a.cpp",
"line_number": 9,
"column_number": 5,
"description": "Write of unused value"
}],
"key": "a.cpp|main|DEAD_STORE",
"hash": "2450f50b11f2b0e0cc6d3bd7d1d6ef77",
"bug_type_hum": "Dead Store"
}, {
"bug_type": "DEAD_STORE",
"qualifier": "The value written to &j (type int) is never used.",
"severity": "ERROR",
"line": 10,
"column": 5,
"procedure": "main",
"procedure_start_line": 4,
"file": "a.cpp",
"bug_trace": [{
"level": 0,
"filename": "a.cpp",
"line_number": 10,
"column_number": 5,
"description": "Write of unused value"
}],
"key": "a.cpp|main|DEAD_STORE",
"hash": "2450f50b11f2b0e0cc6d3bd7d1d6ef77",
"bug_type_hum": "Dead Store"
}]
```
# My questions are -
### As you can see here is no CWE IDs related to the errors. They have name but no CWE ID. Is there anyway to print or get CWE ID using Infer?
### Another question is, In this code, `a[6] = 0` line should give `Array Index Out Of Bound` error or at least warning. Why isn't it giving it? Am I missing something?
# Any help would be appreciated.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.