Skip to content

Commit dc265e7

Browse files
committed
Requested Changes
1 parent a1e38c3 commit dc265e7

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

go/ql/src/experimental/CWE-287/examples/LdapAuthBad.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"log"
6+
7+
"github.com/go-ldap/ldap"
8+
)
9+
110
func bad() interface{} {
211
bindPassword := req.URL.Query()["password"][0]
312

@@ -12,4 +21,4 @@ func bad() interface{} {
1221
if err != nil {
1322
log.Fatalf("LDAP bind failed: %v", err)
1423
}
15-
}
24+
}

go/ql/src/experimental/CWE-287/examples/LdapAuthGood.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"log"
6+
7+
"github.com/go-ldap/ldap"
8+
)
9+
110
func good() interface{} {
211
bindPassword := req.URL.Query()["password"][0]
312

@@ -14,4 +23,4 @@ func good() interface{} {
1423
log.Fatalf("LDAP bind failed: %v", err)
1524
}
1625
}
17-
}
26+
}

0 commit comments

Comments
 (0)