Python: Change variable capture tests to use fresh variable names

Instead of reusing `nonSink0` for both captureOut1NotCalled and
captureOut2NotCalled tests (I used 1/2 naming scheme to match things up
nicely).

I also added a comment highlighting that `m` is the function that is not
called (since I overlooked that initially :O)
This commit is contained in:
Rasmus Wriedt Larsen
2023-05-02 13:56:55 +02:00
parent 54ced06ada
commit c89b57997a
4 changed files with 53 additions and 41 deletions

View File

@@ -48,13 +48,14 @@ def inParam(tainted):
captureIn3("")
def captureIn1NotCalled():
nonSink0 = tainted
SINK_F(nonSink0)
nonSink1 = tainted
SINK_F(nonSink1)
def captureIn2NotCalled():
# notice that `m` is not called
def m():
nonSink0 = tainted
SINK_F(nonSink0)
nonSink1 = tainted
SINK_F(nonSink1)
captureIn2NotCalled()
@expects(3)
@@ -81,13 +82,14 @@ def inLocal():
captureIn3("")
def captureIn1NotCalled():
nonSink0 = tainted
SINK_F(nonSink0)
nonSink1 = tainted
SINK_F(nonSink1)
def captureIn2NotCalled():
# notice that `m` is not called
def m():
nonSink0 = tainted
SINK_F(nonSink0)
nonSink2 = tainted
SINK_F(nonSink2)
captureIn2NotCalled()
@expects(3)