mirror of
https://github.com/github/codeql.git
synced 2026-01-29 14:23:03 +01:00
fix tests
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
| SensitiveConditionBypassBad.go:7:5:7:39 | ...!=... | This sensitive comparision check can potentially be bypassed. |
|
||||
| condition.go:16:5:16:34 | ...!=... | This sensitive comparision check can potentially be bypassed. |
|
||||
| condition.go:25:5:25:35 | ...!=... | This sensitive comparision check can potentially be bypassed. |
|
||||
| condition.go:34:5:34:35 | ...!=... | This sensitive comparision check can potentially be bypassed. |
|
||||
10
ql/test/experimental/CWE-807/SensitiveConditionBypassBad.go
Normal file
10
ql/test/experimental/CWE-807/SensitiveConditionBypassBad.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package main
|
||||
|
||||
import "net/http"
|
||||
|
||||
func example(w http.ResponseWriter, r *http.Request) {
|
||||
test2 := "test"
|
||||
if r.Header.Get("X-Password") != test2 {
|
||||
login()
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ func use(xs ...interface{}) {}
|
||||
func t(xs ...interface{}) string { return "sadsad" }
|
||||
func login(xs ...interface{}) {}
|
||||
|
||||
var test = "localhost"
|
||||
const test = "localhost"
|
||||
|
||||
// Should alert as authkey is sensitive
|
||||
func ex1(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
Reference in New Issue
Block a user