From 9b8114a8efd373e84e62472c52c1f50a3f60d70d Mon Sep 17 00:00:00 2001 From: aliguori Date: Tue, 28 Oct 2008 14:08:49 +0000 Subject: [PATCH] fix off-by-one generating vmdk backing files (Avi Kivity) Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5567 c046a42c-6fe2-441c-8c8c-71466251a162 --- block-vmdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block-vmdk.c b/block-vmdk.c index b8ecdb739a..eefd76beac 100644 --- a/block-vmdk.c +++ b/block-vmdk.c @@ -344,7 +344,7 @@ static int vmdk_parent_open(BlockDriverState *bs, const char * filename) if ((end_name - p_name) > sizeof (s->hd->backing_file) - 1) return -1; - pstrcpy(s->hd->backing_file, end_name - p_name, p_name); + pstrcpy(s->hd->backing_file, end_name - p_name + 1, p_name); if (stat(s->hd->backing_file, &file_buf) != 0) { path_combine(parent_img_name, sizeof(parent_img_name), filename, s->hd->backing_file);