debian-forge-composer/internal/disk
Tomáš Hozza 63f1b8d9fb internal/disk: fix potential nil pointer dereference
The `LVMVolumeGroup.Clone()` method could end up dereferencing a `nil`
pointer in the `lv` variable, if there would be a `nil` logical volume
in the LVM volume group. Such situation would be an error of its own.
There is no point in checking if the cloned logical volume is not `nil`
and casting it to another variable. The logic should check if the cloned
logical volume is `nil` and panic in such situation. The following code
can then cast the clone to a different variable without issues and there
is no risk of dereferencing a `nil` pointer.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
2022-11-07 16:10:41 +01:00
..
btrfs.go disk: rename Create{Volume → Mountpoint} 2022-02-28 17:09:30 +01:00
disk.go distro/*: allow /boot to be customized 2022-08-08 18:05:05 +02:00
disk_test.go distro/*: allow /boot to be customized 2022-08-08 18:05:05 +02:00
filesystem.go disk: guard against nil pointer dereferencing 2022-02-22 19:23:41 +00:00
luks.go Simplified installer: add support for encrypted raw images 2022-02-28 23:05:45 +00:00
lvm.go internal/disk: fix potential nil pointer dereference 2022-11-07 16:10:41 +01:00
lvm_test.go disk: rename Create{Volume → Mountpoint} 2022-02-28 17:09:30 +01:00
partition.go disk: add partition type helpers 2022-02-27 22:03:36 +01:00
partition_table.go internal/disk: fix potential nil pointer dereference 2022-11-07 16:10:41 +01:00
path_policy.go disk: new path policies struct and methods 2022-08-08 18:05:05 +02:00
path_policy_test.go disk: new path policies struct and methods 2022-08-08 18:05:05 +02:00
path_tree_test.go disk: add generic path trie implementation 2022-08-08 18:05:05 +02:00
path_trie.go disk: add generic path trie implementation 2022-08-08 18:05:05 +02:00