Skip to content

Commit a144dc1

Browse files
Fix test_tainted_integers_taint_stored_in_array regression test
1 parent feecd42 commit a144dc1

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

regression/end_to_end/tainted-integers/test_tainted_integers.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import subprocess
3-
import pytest
43

54
from regression.end_to_end.driver import run_security_analyser_pipeline
65
import regression.utils as utils
@@ -42,12 +41,7 @@ def test_tainted_integers_single_function():
4241
assert traces.trace_exists("java::single_function.main:(I)V", 13)
4342

4443

45-
@pytest.mark.xfail(strict=True)
4644
def test_tainted_integers_taint_stored_in_array():
47-
"""
48-
Fails without use of full-slicer (even without any slicer).
49-
TODO: Find out why
50-
"""
5145
with utils.working_dir(os.path.abspath(os.path.dirname(__file__))):
5246
subprocess.call(["flock", ".build_lock", "ant", "compile4"])
5347
traces = run_security_analyser_pipeline(

src/taint-slicer/instrumenter.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,20 @@ void taint_instrumentert::instrument_instructions_with_shadow_variables(
600600
}
601601
}
602602
break;
603+
case OTHER:
604+
if(instr_it->code.get_statement() == ID_array_set)
605+
{
606+
codet &code = instr_it->code;
607+
code.op0() = drive_access_path_through_super_classes(code.op0());
608+
INVARIANT(
609+
can_cast_type<pointer_typet>(code.op0().type()),
610+
"first argument to array_set must be of pointer type");
611+
code.op1() = make_or_update_initialiser(
612+
code.op1(),
613+
ns.follow(code.op0().type().subtype()),
614+
get_instrumented_symbol_table(),
615+
get_names_of_shadow_variables());
616+
}
603617
default:
604618
break;
605619
}

0 commit comments

Comments
 (0)