Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
  • Loading branch information
arthurscchan committed Jan 9, 2024
1 parent 55089e5 commit 6b74f9e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/fuzz_introspector/analyses/data/cwe_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

SINK_FUNCTION = {
from typing import Any, Dict

SINK_FUNCTION: Dict[str, Dict[str, Any]] = {
'CWE79': {
'c-cpp': [
('', 'system'),
Expand Down
6 changes: 3 additions & 3 deletions src/fuzz_introspector/analyses/sinks_analyser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
logger = logging.getLogger(name=__name__)

# List of sink functions for different CWE
SINK_FUNCTION = cwe_data.SINK_FUNCTION
ALL_CWE = list(SINK_FUNCTION)
SINKS = cwe_data.SINK_FUNCTION
CWES = list(SINKS)


class SinkCoverageAnalyser(analysis.AnalysisInterface):
Expand Down Expand Up @@ -226,7 +226,7 @@ def _filter_function_list(
continue

# Add the function profile to the result list if it matches one of the target
if (package, func_name) in SINK_FUNCTION[target_cwe][target_lang]:
if (package, func_name) in SINKS[target_cwe][target_lang]:
function_list.append(fd)

return function_list
Expand Down

0 comments on commit 6b74f9e

Please sign in to comment.