File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
test/query-tests/Security/CWE-020 Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,11 @@ class IndexOfCall extends DataFlow::MethodCallNode {
3535 */
3636 IndexOfCall getAnEquivalentIndexOfCall ( ) {
3737 result .getReceiver ( ) .getALocalSource ( ) = this .getReceiver ( ) .getALocalSource ( ) and
38- result .getArgument ( 0 ) .getALocalSource ( ) = this .getArgument ( 0 ) .getALocalSource ( ) and
38+ (
39+ result .getArgument ( 0 ) .getALocalSource ( ) = this .getArgument ( 0 ) .getALocalSource ( )
40+ or
41+ result .getArgument ( 0 ) .getStringValue ( ) = this .getArgument ( 0 ) .getStringValue ( )
42+ ) and
3943 result .getMethodName ( ) = this .getMethodName ( )
4044 }
4145
Original file line number Diff line number Diff line change 99| tst.js:67:32:67:71 | x.index ... gth - 1 | This suffix check is missing a length comparison to correctly handle indexOf returning -1. |
1010| tst.js:76:25:76:57 | index = ... gth - 1 | This suffix check is missing a length comparison to correctly handle indexOf returning -1. |
1111| tst.js:80:10:80:57 | x.index ... th + 1) | This suffix check is missing a length comparison to correctly handle indexOf returning -1. |
12- | tst.js:94:49:94:112 | x.lastI ... .length | This suffix check is missing a length comparison to correctly handle lastIndexOf returning -1. |
13- | tst.js:98:49:98:112 | x.lastI ... .length | This suffix check is missing a length comparison to correctly handle lastIndexOf returning -1. |
You can’t perform that action at this time.
0 commit comments