Reject backslashes in confined file paths
This commit is contained in:
@@ -19,7 +19,7 @@ func SafePath(root, name string) (string, error) {
|
||||
if name == "" {
|
||||
return "", fmt.Errorf("artifact name must not be empty")
|
||||
}
|
||||
if strings.Contains(name, `\\`) {
|
||||
if strings.ContainsRune(name, '\\') {
|
||||
return "", fmt.Errorf("artifact name %q must use slash-separated relative paths", name)
|
||||
}
|
||||
if path.IsAbs(name) || filepath.IsAbs(name) {
|
||||
|
||||
Reference in New Issue
Block a user