File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
lib/codeql/ruby/frameworks
test/library-tests/frameworks Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -62,9 +62,9 @@ module PosixSpawn {
62
62
// is shell interpreted unless there is another argument with a string
63
63
// constant value.
64
64
override predicate isShellInterpreted ( DataFlow:: Node arg ) {
65
+ this .argument ( arg ) and
65
66
not exists ( DataFlow:: Node otherArg |
66
67
otherArg != arg and
67
- this .argument ( arg ) and
68
68
this .argument ( otherArg ) and
69
69
otherArg .asExpr ( ) .getConstantValue ( ) .isString ( _)
70
70
)
Original file line number Diff line number Diff line change @@ -5,11 +5,13 @@ import codeql.ruby.DataFlow
5
5
query predicate systemCalls (
6
6
PosixSpawn:: SystemCall call , DataFlow:: Node arg , boolean shellInterpreted
7
7
) {
8
- arg = call .getAnArgument ( ) and
9
- if call .isShellInterpreted ( arg ) then shellInterpreted = true else shellInterpreted = false
8
+ call .isShellInterpreted ( arg ) and shellInterpreted = true
9
+ or
10
+ not call .isShellInterpreted ( arg ) and arg = call .getAnArgument ( ) and shellInterpreted = false
10
11
}
11
12
12
13
query predicate childCalls ( PosixSpawn:: ChildCall call , DataFlow:: Node arg , boolean shellInterpreted ) {
13
- arg = call .getAnArgument ( ) and
14
- if call .isShellInterpreted ( arg ) then shellInterpreted = true else shellInterpreted = false
14
+ call .isShellInterpreted ( arg ) and shellInterpreted = true
15
+ or
16
+ not call .isShellInterpreted ( arg ) and arg = call .getAnArgument ( ) and shellInterpreted = false
15
17
}
You can’t perform that action at this time.
0 commit comments