@@ -252,24 +252,32 @@ private void reportVulnerability(CheckToolWithAnalysisResults<
252252 if (functionSignatureByStatement .equals ("no-function-found" ))
253253 return ;
254254
255- log .warn (
256- "[DEFINITE] Access Control Incompleteness vulnerability at pc {} (line {}) coming from pc {} (line {})." ,
257- ((ProgramCounterLocation ) sink .getLocation ()).getPc (),
258- ((ProgramCounterLocation ) sink .getLocation ()).getSourceCodeLine (),
259- ((ProgramCounterLocation ) source .getLocation ()).getPc (),
260- ((ProgramCounterLocation ) source .getLocation ()).getSourceCodeLine ());
261-
262- String warn = "[DEFINITE] Access Control Incompleteness vulnerability at "
263- + ((ProgramCounterLocation ) sink .getLocation ()).getSourceCodeLine ();
264- tool .warn (warn );
265- MyCache .getInstance ().addAccessControlIncompletenessWarning (cfg .hashCode (), warn );
266-
267- warn = "[DEFINITE] Access Control Incompleteness vulnerability in " + contract .getName () + " at "
268- + functionSignatureByStatement
269- + " (pc: " + ((ProgramCounterLocation ) sink .getLocation ()).getPc () + ", "
270- + "line: " + ((ProgramCounterLocation ) sink .getLocation ()).getSourceCodeLine () + ")" ;
271- MyCache .getInstance ().addVulnerabilityPerFunction (cfg .hashCode (), warn );
272-
255+ if (contract .getFunctionSignatureByString (functionSignatureByStatement ).isProtected ()) {
256+ log .warn (
257+ "[POSSIBLE] Access Control Incompleteness vulnerability at pc {} (line {}) coming from pc {} (line {})." ,
258+ ((ProgramCounterLocation ) sink .getLocation ()).getPc (),
259+ ((ProgramCounterLocation ) sink .getLocation ()).getSourceCodeLine (),
260+ ((ProgramCounterLocation ) source .getLocation ()).getPc (),
261+ ((ProgramCounterLocation ) source .getLocation ()).getSourceCodeLine ());
262+ } else {
263+ log .warn (
264+ "[DEFINITE] Access Control Incompleteness vulnerability at pc {} (line {}) coming from pc {} (line {})." ,
265+ ((ProgramCounterLocation ) sink .getLocation ()).getPc (),
266+ ((ProgramCounterLocation ) sink .getLocation ()).getSourceCodeLine (),
267+ ((ProgramCounterLocation ) source .getLocation ()).getPc (),
268+ ((ProgramCounterLocation ) source .getLocation ()).getSourceCodeLine ());
269+
270+ String warn = "[DEFINITE] Access Control Incompleteness vulnerability at "
271+ + ((ProgramCounterLocation ) sink .getLocation ()).getSourceCodeLine ();
272+ tool .warn (warn );
273+ MyCache .getInstance ().addAccessControlIncompletenessWarning (cfg .hashCode (), warn );
274+
275+ warn = "[DEFINITE] Access Control Incompleteness vulnerability in " + contract .getName () + " at "
276+ + functionSignatureByStatement
277+ + " (pc: " + ((ProgramCounterLocation ) sink .getLocation ()).getPc () + ", "
278+ + "line: " + ((ProgramCounterLocation ) sink .getLocation ()).getSourceCodeLine () + ")" ;
279+ MyCache .getInstance ().addVulnerabilityPerFunction (cfg .hashCode (), warn );
280+ }
273281 }
274282
275283}
0 commit comments