File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
javascript/ql/src/semmle/javascript/security/dataflow Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -120,25 +120,18 @@ module Shared {
120
120
)
121
121
}
122
122
123
- private import semmle.javascript.dataflow.internal.AccessPaths as Paths
124
-
125
123
/**
126
- * Gets an access-path that is used in a sanitizing switch statement.
127
- * The `pragma[noinline]` is to avoid materializing a cartesian product of all access-paths .
124
+ * Gets an Ssa variable that is used in a sanitizing switch statement.
125
+ * The `pragma[noinline]` is to avoid materializing a cartesian product.
128
126
*/
129
127
pragma [ noinline]
130
- private Paths:: AccessPath getAPathEscapedInSwitch ( ) {
131
- exists ( Expr str |
132
- isUsedInHTMLEscapingSwitch ( str ) and
133
- result .getAnInstance ( ) = str
134
- )
135
- }
128
+ private SsaVariable getAPathEscapedInSwitch ( ) { isUsedInHTMLEscapingSwitch ( result .getAUse ( ) ) }
136
129
137
130
/**
138
131
* An expression that is sanitized by a switch-case.
139
132
*/
140
133
class IsEscapedInSwitchSanitizer extends Sanitizer {
141
- IsEscapedInSwitchSanitizer ( ) { this .asExpr ( ) = getAPathEscapedInSwitch ( ) .getAnInstance ( ) }
134
+ IsEscapedInSwitchSanitizer ( ) { this .asExpr ( ) = getAPathEscapedInSwitch ( ) .getAUse ( ) }
142
135
}
143
136
}
144
137
You can’t perform that action at this time.
0 commit comments