fix off-by-one generating vmdk backing files (Avi Kivity)

Signed-off-by: Avi Kivity <avi@redhat.com> 
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5567 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
aliguori 2008-10-28 14:08:49 +00:00
parent 3d878caab9
commit 9b8114a8ef

View File

@ -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) if ((end_name - p_name) > sizeof (s->hd->backing_file) - 1)
return -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) { if (stat(s->hd->backing_file, &file_buf) != 0) {
path_combine(parent_img_name, sizeof(parent_img_name), path_combine(parent_img_name, sizeof(parent_img_name),
filename, s->hd->backing_file); filename, s->hd->backing_file);