Skip to content

Commit 1cf8505

Browse files
lzapdiscordianfish
authored andcommitted
net_dev_snmp6: directory traversal
Fix a theoretical directory traversal to silence security scanners in our vendor/ directory. Signed-off-by: Lukas Zapletal <[email protected]>
1 parent 91dd824 commit 1cf8505

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net_dev_snmp6.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"errors"
1919
"io"
2020
"os"
21+
"path/filepath"
2122
"strconv"
2223
"strings"
2324
)
@@ -56,7 +57,9 @@ func newNetDevSNMP6(dir string) (NetDevSNMP6, error) {
5657
}
5758

5859
for _, iFaceFile := range ifaceFiles {
59-
f, err := os.Open(dir + "/" + iFaceFile.Name())
60+
filePath := filepath.Join(dir, iFaceFile.Name())
61+
62+
f, err := os.Open(filePath)
6063
if err != nil {
6164
return netDevSNMP6, err
6265
}

0 commit comments

Comments
 (0)