mirror of
https://github.com/github/codeql.git
synced 2026-04-18 05:24:01 +02:00
add test case for unicodeScalars
This commit is contained in:
@@ -114,13 +114,16 @@ func taintThroughData() {
|
||||
|
||||
func sink(arg: String.UTF8View) {}
|
||||
func sink(arg: ContiguousArray<CChar>) {}
|
||||
func sink(arg: String.UnicodeScalarView) {}
|
||||
|
||||
func taintThroughStringFields() {
|
||||
let clean = ""
|
||||
let tainted = source2().utf8
|
||||
let taintedCString = source2().utf8CString
|
||||
let taintedUnicodeScalars = source2().unicodeScalars
|
||||
|
||||
sink(arg: clean)
|
||||
sink(arg: tainted) // $ tainted=120
|
||||
sink(arg: taintedCString) // $ tainted=121
|
||||
sink(arg: tainted) // $ tainted=121
|
||||
sink(arg: taintedCString) // $ tainted=122
|
||||
sink(arg: taintedUnicodeScalars) // $ tainted=123
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user