mirror of
https://github.com/containers/podman.git
synced 2025-06-18 15:39:08 +08:00
spec: protect against segfault
when the user passes in "/dev/null::w" Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
@ -173,7 +173,7 @@ func ParseDevice(device string) (string, string, string, error) { //nolint
|
||||
if IsValidDeviceMode(arr[1]) {
|
||||
permissions = arr[1]
|
||||
} else {
|
||||
if arr[1][0] != '/' {
|
||||
if len(arr[1]) == 0 || arr[1][0] != '/' {
|
||||
return "", "", "", fmt.Errorf("invalid device mode: %s", arr[1])
|
||||
}
|
||||
dst = arr[1]
|
||||
|
Reference in New Issue
Block a user