From: Alwin Antreich Date: Mon, 28 Aug 2017 09:08:12 +0000 (+0200) Subject: Fix #1480: die if snapshot name is not found before set_lock is used X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=4c3144eaa62f165fa69c395863d0226b71cd4d31;p=pve-guest-common.git Fix #1480: die if snapshot name is not found before set_lock is used Signed-off-by: Alwin Antreich --- diff --git a/PVE/AbstractConfig.pm b/PVE/AbstractConfig.pm index 64d19e4..3473988 100644 --- a/PVE/AbstractConfig.pm +++ b/PVE/AbstractConfig.pm @@ -480,9 +480,13 @@ sub snapshot_delete { my $prepare = 1; - my $snap; my $unused = []; + my $conf = $class->load_config($vmid); + my $snap = $conf->{snapshots}->{$snapname}; + + die "snapshot '$snapname' does not exist\n" if !defined($snap); + $class->set_lock($vmid, 'snapshot-delete') if (!$drivehash); # doesn't already have a 'snapshot' lock