From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NXdOl-0005zz-Na for qemu-devel@nongnu.org; Wed, 20 Jan 2010 11:27:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NXdOh-0005vT-KS for qemu-devel@nongnu.org; Wed, 20 Jan 2010 11:27:15 -0500 Received: from [199.232.76.173] (port=42445 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NXdOh-0005v5-AE for qemu-devel@nongnu.org; Wed, 20 Jan 2010 11:27:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13153) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NXdOg-0006dT-80 for qemu-devel@nongnu.org; Wed, 20 Jan 2010 11:27:11 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0KGQujO023426 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Jan 2010 11:26:56 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0KGQsmb017549 for ; Wed, 20 Jan 2010 11:26:54 -0500 Received: from amt.cnet (vpn-9-48.rdu.redhat.com [10.11.9.48]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o0KGQqAu014798 for ; Wed, 20 Jan 2010 11:26:53 -0500 Received: from amt.cnet (amt.cnet [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 787226520EA for ; Wed, 20 Jan 2010 14:26:35 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.3/8.14.3/Submit) id o0KGQY1K015311 for qemu-devel@nongnu.org; Wed, 20 Jan 2010 14:26:34 -0200 Date: Wed, 20 Jan 2010 14:26:34 -0200 From: Marcelo Tosatti Message-ID: <20100120162634.GA15296@amt.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] fix savevm command without id or tag List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 diff --git a/savevm.c b/savevm.c index b3bb909..2fd3de6 100644 --- a/savevm.c +++ b/savevm.c @@ -1718,7 +1718,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; }