Skip to content

Commit 4adc373

Browse files
committed
Ruby: more test cases for code injection via method
1 parent 3418ec8 commit 4adc373

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ruby/ql/test/library-tests/frameworks/core/Kernel.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ methodCallCodeExecutions
4646
| Kernel.rb:92:1:92:14 | call to method | Kernel.rb:92:8:92:13 | "exit" |
4747
| Kernel.rb:93:1:93:21 | call to public_method | Kernel.rb:93:15:93:20 | "exit" |
4848
| Kernel.rb:94:1:94:23 | call to singleton_method | Kernel.rb:94:18:94:22 | "foo" |
49+
| Kernel.rb:96:1:96:18 | call to method | Kernel.rb:96:12:96:17 | "exit" |
50+
| Kernel.rb:97:1:97:25 | call to public_method | Kernel.rb:97:19:97:24 | "exit" |
51+
| Kernel.rb:98:1:98:27 | call to singleton_method | Kernel.rb:98:22:98:26 | "foo" |
4952
evalCallCodeExecutions
5053
| Eval.rb:3:1:3:43 | call to eval | Eval.rb:3:6:3:22 | "raise \\"error\\"" |
5154
| Kernel.rb:1:1:1:43 | call to eval | Kernel.rb:1:6:1:22 | "raise \\"error\\"" |

ruby/ql/test/library-tests/frameworks/core/Kernel.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,7 @@ def run
9292
method("exit").call
9393
public_method("exit").call
9494
singleton_method("foo").call
95+
96+
Foo.method("exit").call
97+
Foo.public_method("exit").call
98+
Foo.singleton_method("foo").call

0 commit comments

Comments
 (0)