File tree 1 file changed +8
-1
lines changed
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -128,18 +128,25 @@ bool CweMap::assignCwe(Defect &def) const {
128
128
}
129
129
130
130
// lookup by event
131
+ int &cweDst = def.cwe ;
131
132
const Private::TNumByEvent &row = rowIt->second ;
132
133
const DefEvent &evt = def.events [def.keyEventIdx ];
133
134
Private::TNumByEvent::const_iterator cweIt = row.find (evt.event );
134
135
if (row.end () == cweIt) {
135
136
if (!d->silent )
136
137
std::cerr << " warning: CWE not found: checker = " << def.checker
137
138
<< " , event = " << evt.event << " \n " ;
139
+
140
+ if (def.checker == " CPPCHECK_WARNING" ) {
141
+ // we cannot fallback to a random CWE that Cppcheck has mapping for
142
+ cweDst = 0 ;
143
+ return false ;
144
+ }
145
+
138
146
cweIt = row.begin ();
139
147
}
140
148
141
149
const int cweSrc = cweIt->second ;
142
- int &cweDst = def.cwe ;
143
150
if (cweSrc == cweDst)
144
151
// already assigned
145
152
return true ;
You can’t perform that action at this time.
0 commit comments