|
| 1 | +import 'dummy'; |
| 2 | + |
| 3 | +function t1() { |
| 4 | + function target(...rest) { |
| 5 | + sink(rest[0]); // $ hasValueFlow=t1.1 |
| 6 | + sink(rest[1]); // $ hasValueFlow=t1.2 |
| 7 | + sink(rest.join(',')); // $ hasTaintFlow=t1.1 hasTaintFlow=t1.2 |
| 8 | + } |
| 9 | + target(source('t1.1'), source('t1.2')); |
| 10 | +} |
| 11 | + |
| 12 | +function t2() { |
| 13 | + function target(x, ...rest) { |
| 14 | + sink(x); // $ hasValueFlow=t2.1 |
| 15 | + sink(rest.join(',')); // $ hasTaintFlow=t2.2 hasTaintFlow=t2.3 |
| 16 | + } |
| 17 | + target(source('t2.1'), source('t2.2'), source('t2.3')); |
| 18 | +} |
| 19 | + |
| 20 | +function t3() { |
| 21 | + function finalTarget(x, y, z) { |
| 22 | + sink(x); // $ hasValueFlow=t3.1 |
| 23 | + sink(y); // $ hasValueFlow=t3.2 |
| 24 | + sink(z); // $ hasValueFlow=t3.3 |
| 25 | + } |
| 26 | + function target(...rest) { |
| 27 | + finalTarget(...rest); |
| 28 | + } |
| 29 | + target(source('t3.1'), source('t3.2'), source('t3.3')); |
| 30 | +} |
| 31 | + |
| 32 | +function t4() { |
| 33 | + function finalTarget(w, x, y, z) { |
| 34 | + sink(w); // $ hasValueFlow=t4.0 |
| 35 | + sink(x); // $ hasValueFlow=t4.1 |
| 36 | + sink(y); // $ hasValueFlow=t4.2 |
| 37 | + sink(z); // $ hasValueFlow=t4.3 |
| 38 | + } |
| 39 | + function target(...rest) { |
| 40 | + finalTarget(source('t4.0'), ...rest); |
| 41 | + } |
| 42 | + target(source('t4.1'), source('t4.2'), source('t4.3')); |
| 43 | +} |
| 44 | + |
| 45 | +function t5() { |
| 46 | + function finalTarget(w, x, y, z) { |
| 47 | + sink(w); // $ hasValueFlow=t5.0 |
| 48 | + sink(x); // $ hasValueFlow=t5.1 |
| 49 | + sink(y); // $ hasValueFlow=t5.2 |
| 50 | + sink(z); // $ hasValueFlow=t5.3 |
| 51 | + } |
| 52 | + function target(array) { |
| 53 | + finalTarget(source('t5.0'), ...array); |
| 54 | + } |
| 55 | + target([source('t5.1'), source('t5.2'), source('t5.3')]); |
| 56 | +} |
| 57 | + |
| 58 | +function t6() { |
| 59 | + function target(x) { |
| 60 | + sink(x); // $ hasValueFlow=t6.1 |
| 61 | + sink(arguments[0]);// $ hasValueFlow=t6.1 |
| 62 | + sink(arguments[1]);// $ hasValueFlow=t6.2 |
| 63 | + sink(arguments[2]);// $ hasValueFlow=t6.3 |
| 64 | + } |
| 65 | + target(source('t6.1'), source('t6.2'), source('t6.3')); |
| 66 | +} |
| 67 | + |
| 68 | +function t7() { |
| 69 | + function finalTarget(x, y, z) { |
| 70 | + sink(x); // $ hasValueFlow=t7.1 |
| 71 | + sink(y); // $ hasValueFlow=t7.2 |
| 72 | + sink(z); // $ hasValueFlow=t7.3 |
| 73 | + } |
| 74 | + function target() { |
| 75 | + finalTarget(...arguments); |
| 76 | + } |
| 77 | + target(source('t7.1'), source('t7.2'), source('t7.3')); |
| 78 | +} |
| 79 | + |
| 80 | +function t8() { |
| 81 | + function finalTarget(x, y, z) { |
| 82 | + sink(x); // $ hasValueFlow=t8.1 SPURIOUS: hasValueFlow=t8.3 |
| 83 | + sink(y); // $ hasValueFlow=t8.2 SPURIOUS: hasValueFlow=t8.3 hasValueFlow=t8.4 |
| 84 | + sink(z); // $ hasValueFlow=t8.3 SPURIOUS: hasValueFlow=t8.3 hasValueFlow=t8.4 |
| 85 | + } |
| 86 | + function target(array1, array2) { |
| 87 | + finalTarget(...array1, ...array2); |
| 88 | + } |
| 89 | + target([source('t8.1'), source('t8.2')], [source('t8.3'), source('t8.4')]); |
| 90 | +} |
| 91 | + |
| 92 | +function t9() { |
| 93 | + function finalTarget(x, y, z) { |
| 94 | + sink(x); // $ hasValueFlow=t9.1 |
| 95 | + sink(y); // $ hasValueFlow=t9.2 |
| 96 | + sink(z); // $ hasValueFlow=t9.3 |
| 97 | + } |
| 98 | + function target() { |
| 99 | + finalTarget.apply(undefined, arguments); |
| 100 | + } |
| 101 | + target(source('t9.1'), source('t9.2'), source('t9.3')); |
| 102 | +} |
| 103 | + |
| 104 | +function t10() { |
| 105 | + function finalTarget(x, y, z) { |
| 106 | + sink(x); // $ hasValueFlow=t10.1 |
| 107 | + sink(y); // $ hasValueFlow=t10.2 |
| 108 | + sink(z); // $ hasValueFlow=t10.3 |
| 109 | + } |
| 110 | + function target(...rest) { |
| 111 | + finalTarget.apply(undefined, rest); |
| 112 | + } |
| 113 | + target(source('t10.1'), source('t10.2'), source('t10.3')); |
| 114 | +} |
0 commit comments