File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
swift/ql/test/library-tests/dataflow/taint/core Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -68,3 +68,21 @@ func taintThroughAssignmentArithmetic() {
6868 e %= 100
6969 sink ( arg: e) // $ tainted=66
7070}
71+
72+ func taintThroughBitwiseOperators( ) {
73+ sink ( arg: 0 | source ( ) ) // $ MISSING: tainted=73
74+ sink ( arg: source ( ) | 0 ) // $ MISSING: tainted=74
75+
76+ sink ( arg: 0xffff & source ( ) ) // $ MISSING: tainted=76
77+ sink ( arg: source ( ) & 0xffff ) // $ MISSING: tainted=77
78+
79+ sink ( arg: 0xffff ^ source ( ) ) // $ MISSING: tainted=79
80+ sink ( arg: source ( ) ^ 0xffff ) // $ MISSING: tainted=80
81+
82+ sink ( arg: source ( ) << 1 ) // $ MISSING: tainted=82
83+ sink ( arg: source ( ) &<< 1 ) // $ MISSING: tainted=83
84+ sink ( arg: source ( ) >> 1 ) // $ MISSING: tainted=84
85+ sink ( arg: source ( ) &>> 1 ) // $ MISSING: tainted=85
86+
87+ sink ( arg: ~ source( ) ) // $ MISSING: tainted=87
88+ }
You can’t perform that action at this time.
0 commit comments