Skip to content

Commit d10fc19

Browse files
authored
Bring back comment for nosec (#231)
Signed-off-by: thepetk <[email protected]>
1 parent 7c89891 commit d10fc19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

registry-library/library/util.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ func decompress(targetDir string, tarFile string, excludeFiles []string) error {
122122
return returnedErr
123123
}
124124
case tar.TypeReg:
125+
/* #nosec G304 -- target is produced using path.Join which cleans the dir path */
125126
w, err := os.OpenFile(target, os.O_CREATE|os.O_RDWR, os.FileMode(header.Mode))
126127
if err != nil {
127128
returnedErr = multierror.Append(returnedErr, err)
@@ -194,7 +195,7 @@ func getHTTPClient(options RegistryOptions) *http.Client {
194195

195196
// Cleans a child path to ensure that there is no escaping from the parent directory with the use of ../ escape methods
196197
// Ensures that the child path is always contained and absolutely pathed from the parent
197-
func CleanFilepath(parent string, child string)string{
198+
func CleanFilepath(parent string, child string) string {
198199
target := path.Join(parent, filepath.Clean("/"+child))
199200
return target
200201
}

0 commit comments

Comments
 (0)