We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 18a8451 commit 35ed8d5Copy full SHA for 35ed8d5
1 file changed
builder/azure/chroot/builder.go
@@ -443,10 +443,8 @@ func validateLVMRootDevice(device string) error {
443
cleaned := posixpath.Clean(device)
444
445
// Check for path traversal: reject if any component is ".."
446
- for _, component := range strings.Split(cleaned, "/") {
447
- if component == ".." {
448
- return fmt.Errorf("%q must not contain path traversal (..)", device)
449
- }
+ if slices.Contains(strings.Split(cleaned, "/"), "..") {
+ return fmt.Errorf("%q must not contain path traversal (..)", device)
450
}
451
452
if !strings.HasPrefix(cleaned, "/dev/") {
0 commit comments