From: Marcelo Tosatti Date: Wed, 20 Jan 2010 16:26:34 +0000 (-0200) Subject: fix savevm command without id or tag X-Git-Tag: v0.12.3~43 X-Git-Url: https://git.proxmox.com/?p=qemu.git;a=commitdiff_plain;h=dc88aa49b4af7a75ae448fe4c57248c2f1d6eb09 fix savevm command without id or tag savevm without id or tag segfaults in: (gdb) bt #0 0x00007f600a83bf8a in __strcmp_sse42 () from /lib64/libc.so.6 #1 0x00000000004745b6 in bdrv_snapshot_find (bs=, sn_info=0x7fff996be280, name=0x0) at savevm.c:1631 #2 0x0000000000475c80 in del_existing_snapshots (name=, mon=) at savevm.c:1654 #3 do_savevm (name=, mon=) Signed-off-by: Marcelo Tosatti Signed-off-by: Anthony Liguori (cherry picked from commit f139a4125682ecd45d96c2d1523443d1be65405c) --- diff --git a/savevm.c b/savevm.c index aefe052cd..cb4105a4b 100644 --- a/savevm.c +++ b/savevm.c @@ -1696,7 +1696,7 @@ void do_savevm(Monitor *mon, const QDict *qdict) sn->vm_clock_nsec = qemu_get_clock(vm_clock); /* Delete old snapshots of the same name */ - if (del_existing_snapshots(mon, name) < 0) { + if (name && del_existing_snapshots(mon, name) < 0) { goto the_end; }