Skip to content

Commit 4598e8b

Browse files
Add positive and negative tests and test runner for Zap encoder sanitizer
1 parent 9d49550 commit 4598e8b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
)
6+
7+
func main() {
8+
userInput := readUser() // source: tainted
9+
fmt.Println(userInput) // sink: logging/printing (should be flagged by a positive test)
10+
}
11+
12+
func readUser() string { return "line\ninjection" }

0 commit comments

Comments
 (0)