mirror of
https://github.com/securego/gosec.git
synced 2025-06-14 23:45:03 +02:00
Find G303 with filepath.Join'd temp dirs (#754)
This commit is contained in:
@ -1759,6 +1759,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -1796,7 +1797,11 @@ func main() {
|
||||
if err != nil {
|
||||
fmt.Println("Error while writing!")
|
||||
}
|
||||
}`}, 8, gosec.NewConfig()}}
|
||||
err = os.WriteFile(filepath.Join(os.TempDir(), "demo2"), []byte("This is some data"), 0644)
|
||||
if err != nil {
|
||||
fmt.Println("Error while writing!")
|
||||
}
|
||||
}`}, 9, gosec.NewConfig()}}
|
||||
|
||||
// SampleCodeG304 - potential file inclusion vulnerability
|
||||
SampleCodeG304 = []CodeSample{{[]string{`
|
||||
|
Reference in New Issue
Block a user