From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40961) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VappN-0004aM-Fl for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:38:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VappF-00079V-VO for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:38:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60278) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VappF-00078w-Mr for qemu-devel@nongnu.org; Mon, 28 Oct 2013 12:37:57 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r9SGbtlO000890 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 Oct 2013 12:37:55 -0400 Date: Mon, 28 Oct 2013 17:37:53 +0100 From: Kevin Wolf Message-ID: <20131028163753.GA3576@dhcp-200-207.str.redhat.com> References: <1382795083-28591-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1382795083-28591-1-git-send-email-mreitz@redhat.com> Subject: Re: [Qemu-devel] [PATCH] block: Don't copy backing file name on error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: qemu-devel@nongnu.org, Stefan Hajnoczi Am 26.10.2013 um 15:44 hat Max Reitz geschrieben: > bdrv_open_backing_file() tries to copy the backing file name using > pstrcpy directly after calling bdrv_open() to open the backing file > without checking whether that was actually successful. If it was not, > ps->backing_hd->file will probably be NULL and qemu will crash. > > Fix this by moving pstrcpy after checking whether bdrv_open() succeeded. > > Signed-off-by: Max Reitz Thanks, applied. A test case wouldn't hurt, though. Kevin