mirror of
https://github.com/securego/gosec.git
synced 2025-07-07 00:35:35 +02:00
Rebase to master
This commit is contained in:
@ -206,7 +206,28 @@ func main(){
|
||||
panic(err)
|
||||
}
|
||||
defer rows.Close()
|
||||
}`, 1}, {
|
||||
}`, 1}, {`
|
||||
// Format string false positive, safe string spec.
|
||||
package main
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"os"
|
||||
//_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
func main(){
|
||||
db, err := sql.Open("sqlite3", ":memory:")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
q := fmt.Sprintf("SELECT * FROM foo where id = %d", os.Args[1])
|
||||
rows, err := db.Query(q)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer rows.Close()
|
||||
}`, 0}, {
|
||||
`
|
||||
// Format string false positive
|
||||
package main
|
||||
|
Reference in New Issue
Block a user