mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Resolve issues with G304 (#10115)
This commit is contained in:
@@ -48,7 +48,7 @@ func DeleteAndCreateFile(tmpPath, fileName string) (*os.File, error) {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
newFile, err := os.Create(path.Join(tmpPath, fileName))
|
||||
newFile, err := os.Create(filepath.Clean(path.Join(tmpPath, fileName)))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -161,7 +161,7 @@ func WritePprofFiles(testDir string, index int) error {
|
||||
return writeURLRespAtPath(url, filePath)
|
||||
}
|
||||
|
||||
func writeURLRespAtPath(url, filePath string) error {
|
||||
func writeURLRespAtPath(url, fp string) error {
|
||||
resp, err := http.Get(url) // #nosec G107 -- Safe, used internally
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -176,7 +176,7 @@ func writeURLRespAtPath(url, filePath string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
file, err := os.Create(filePath)
|
||||
file, err := os.Create(filepath.Clean(fp))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user