mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user