File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -124,11 +124,6 @@ private class ComposedFunctionTaintStep extends TaintTracking::AdditionalTaintSt
124
124
125
125
override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
126
126
exists ( int fnIndex , DataFlow:: FunctionNode fn | fn = composed .getOperandFunction ( fnIndex ) |
127
- // flow out of the composed call
128
- fnIndex = 0 and
129
- pred = fn .getReturnNode ( ) and
130
- succ = this
131
- or
132
127
// flow into the first function
133
128
fnIndex = composed .getNumOperand ( ) - 1 and
134
129
exists ( int callArgIndex |
@@ -141,6 +136,11 @@ private class ComposedFunctionTaintStep extends TaintTracking::AdditionalTaintSt
141
136
pred = predFn .getReturnNode ( ) and
142
137
succ = fn .getParameter ( 0 )
143
138
)
139
+ or
140
+ // flow out of the composed call
141
+ fnIndex = 0 and
142
+ pred = fn .getReturnNode ( ) and
143
+ succ = this
144
144
)
145
145
}
146
146
}
Original file line number Diff line number Diff line change @@ -734,6 +734,8 @@ private class ReactRouterLocationSource extends DOM::LocationSource::Range {
734
734
* version of that component, which we model as a direct reference to the underlying component.
735
735
*/
736
736
private DataFlow:: SourceNode higherOrderComponentBuilder ( ) {
737
+ // `memo(f)` returns a function that behaves as `f` but caches results
738
+ // It is sometimes used to wrap an entire functional component.
737
739
result = react ( ) .getAPropertyRead ( "memo" )
738
740
or
739
741
result = DataFlow:: moduleMember ( "react-redux" , "connect" ) .getACall ( )
@@ -760,8 +762,6 @@ private class HigherOrderComponentStep extends PreCallGraphStep {
760
762
}
761
763
762
764
override predicate step ( DataFlow:: Node pred , DataFlow:: Node succ ) {
763
- // `memo(f)` returns a function behaves as `f` but caches results
764
- // It is sometimes used to wrap an entire functional component.
765
765
exists ( DataFlow:: CallNode call |
766
766
call = higherOrderComponentBuilder ( ) .getACall ( ) and
767
767
pred = call .getArgument ( 0 ) and
You can’t perform that action at this time.
0 commit comments