mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2026-02-02 07:35:12 +01:00
fix(filepath): fixes of potential file inclusion via variable (#322)
Signed-off-by: nisarg1499 <nisshah1499@gmail.com>
This commit is contained in:
parent
a8376796b7
commit
0ebab22224
2 changed files with 4 additions and 3 deletions
|
|
@ -62,7 +62,7 @@ func Get() string {
|
|||
}
|
||||
|
||||
path := filepath.Join(os.Getenv("GOPATH") + versionFile)
|
||||
vBytes, err := ioutil.ReadFile(path)
|
||||
vBytes, err := ioutil.ReadFile(filepath.Clean(path))
|
||||
if err != nil {
|
||||
klog.Errorf("failed to get version: %s", err.Error())
|
||||
return ""
|
||||
|
|
@ -81,7 +81,7 @@ func GetBuildMeta() string {
|
|||
}
|
||||
|
||||
path := filepath.Join(os.Getenv("GOPATH") + buildMetaFile)
|
||||
vBytes, err := ioutil.ReadFile(path)
|
||||
vBytes, err := ioutil.ReadFile(filepath.Clean(path))
|
||||
if err != nil {
|
||||
klog.Errorf("failed to get build version: %s", err.Error())
|
||||
return ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue