mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
20191217 gosec (#796)
* Add gosec to the Makefile Signed-off-by: Chris Cummer <chriscummer@me.com> * Fix some issues found by gosec Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -127,7 +128,7 @@ func OpenFile(path string) {
|
||||
|
||||
// ReadFileBytes reads the contents of a file and returns those contents as a slice of bytes
|
||||
func ReadFileBytes(filePath string) ([]byte, error) {
|
||||
fileData, err := ioutil.ReadFile(filePath)
|
||||
fileData, err := ioutil.ReadFile(filepath.Clean(filePath))
|
||||
if err != nil {
|
||||
return []byte{}, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user