1
0
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:
Jon McClintock
2018-01-22 18:45:07 +00:00
parent 8eb9cc02a4
commit 1ca335016a
2 changed files with 27 additions and 9 deletions

View File

@ -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