Skip to content

Commit d31a7ec

Browse files
kdudkalzaoral
authored andcommitted
csparser: do not reject <Unknown> produced by symbiotic2cs
Fixes: #37 Closes: #38
1 parent 2c3b7ce commit d31a7ec

File tree

5 files changed

+88
-1
lines changed

5 files changed

+88
-1
lines changed

src/csparser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ class ErrFileLexer {
155155
RE("^Error: *(" RE_CHECKER_NAME ")( *\\([^)]+\\))? *:(?: \\[#def[0-9]+\\])?$");
156156

157157
const RE reEvent_ =
158-
RE(/* location */ "^([^:]+)(?::([0-9]+|<unknown>))?(?::([0-9]+))?"
158+
RE(/* location */ "^([^:]+)(?::([0-9]+|<[Uu]nknown>))?(?::([0-9]+))?"
159159
/* evt/mesg */ ": (" RE_EVENT "): (.*)$");
160160
};
161161

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--mode=json
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Error: SYMBIOTIC_WARNING:
2+
<Unknown>:<Unknown>: error: memory error: out of bound pointer
3+
/builddir/build/BUILD/gnupg-2.3.2/common/membuf.c:114: note: call stack: function put_membuf (=0, =0, =3)
4+
/builddir/build/BUILD/gnupg-2.3.2/common/membuf.c:136: note: call stack: function put_membuf_str (=0, =0)
5+
/builddir/build/BUILD/gnupg-2.3.2/common/mapstrings.c:156: note: call stack: function map_static_macro_string (=0)
6+
/builddir/build/BUILD/gnupg-2.3.2/common/t-mapstrings.c:68: note: call stack: function test_map_static_macro_string ()
7+
/builddir/build/BUILD/gnupg-2.3.2/common/t-mapstrings.c:97: note: call stack: function main (=2, =0)
8+
<Unknown>:<Unknown>: note: Additional Info: address: 255:0
9+
<Unknown>:<Unknown>: note: Additional Info: pointing to: none
10+
/builddir/build/BUILD/gnupg-2.3.2/common/membuf.c:52:13: note: Non-deterministic values: gcry_malloc: len 8 bytes, [0xff|7 times 0x0] (i64: 255)
11+
/builddir/build/BUILD/gnupg-2.3.2/common/membuf.c:52:13 (offset): note: Non-deterministic values: gcry_malloc: len 8 bytes, [8 times 0x0] (i64: 0)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"defects": [
3+
{
4+
"checker": "SYMBIOTIC_WARNING",
5+
"key_event_idx": 0,
6+
"events": [
7+
{
8+
"file_name": "<Unknown>",
9+
"line": 0,
10+
"event": "error",
11+
"message": "memory error: out of bound pointer",
12+
"verbosity_level": "0"
13+
},
14+
{
15+
"file_name": "/builddir/build/BUILD/gnupg-2.3.2/common/membuf.c",
16+
"line": 114,
17+
"event": "note",
18+
"message": "call stack: function put_membuf (=0, =0, =3)",
19+
"verbosity_level": "1"
20+
},
21+
{
22+
"file_name": "/builddir/build/BUILD/gnupg-2.3.2/common/membuf.c",
23+
"line": 136,
24+
"event": "note",
25+
"message": "call stack: function put_membuf_str (=0, =0)",
26+
"verbosity_level": "1"
27+
},
28+
{
29+
"file_name": "/builddir/build/BUILD/gnupg-2.3.2/common/mapstrings.c",
30+
"line": 156,
31+
"event": "note",
32+
"message": "call stack: function map_static_macro_string (=0)",
33+
"verbosity_level": "1"
34+
},
35+
{
36+
"file_name": "/builddir/build/BUILD/gnupg-2.3.2/common/t-mapstrings.c",
37+
"line": 68,
38+
"event": "note",
39+
"message": "call stack: function test_map_static_macro_string ()",
40+
"verbosity_level": "1"
41+
},
42+
{
43+
"file_name": "/builddir/build/BUILD/gnupg-2.3.2/common/t-mapstrings.c",
44+
"line": 97,
45+
"event": "note",
46+
"message": "call stack: function main (=2, =0)",
47+
"verbosity_level": "1"
48+
},
49+
{
50+
"file_name": "<Unknown>",
51+
"line": 0,
52+
"event": "note",
53+
"message": "Additional Info: address: 255:0",
54+
"verbosity_level": "1"
55+
},
56+
{
57+
"file_name": "<Unknown>",
58+
"line": 0,
59+
"event": "note",
60+
"message": "Additional Info: pointing to: none",
61+
"verbosity_level": "1"
62+
},
63+
{
64+
"file_name": "/builddir/build/BUILD/gnupg-2.3.2/common/membuf.c",
65+
"line": 52,
66+
"column": 13,
67+
"event": "note",
68+
"message": "Non-deterministic values: gcry_malloc: len 8 bytes, [0xff|7 times 0x0] (i64: 255)\n/builddir/build/BUILD/gnupg-2.3.2/common/membuf.c:52:13 (offset): note: Non-deterministic values: gcry_malloc: len 8 bytes, [8 times 0x0] (i64: 0)",
69+
"verbosity_level": "1"
70+
}
71+
]
72+
}
73+
]
74+
}

tests/csgrep/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,4 @@ test_csgrep("75-coverity-from-cshtml" )
122122
test_csgrep("76-filter-file-basic" )
123123
test_csgrep("77-filter-file-checker-regex" )
124124
test_csgrep("78-json-parser-snyk-code" )
125+
test_csgrep("79-csparser-symbiotic" )

0 commit comments

Comments
 (0)