qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error
Date: Tue, 10 Feb 2015 16:42:14 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 2015-02-10 at 13:22, Jeff Cody wrote:
The size compared should be PATH_MAX, rather than sizeof(char *).

Reported-by: Paolo Bonzini <address@hidden>
Signed-off-by: Jeff Cody <address@hidden>
---
  block/vmdk.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

I just noticed iotest 059 failing, bisected it and the changeset of the commit in question looked strangely related to a patch I seemed to recall having seen on qemu-devel today... :-)

Reviewed-by: Max Reitz <address@hidden>

diff --git a/block/vmdk.c b/block/vmdk.c
index 7d079ad..8410a15 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -843,8 +843,7 @@ static int vmdk_parse_extents(const char *desc, 
BlockDriverState *bs,
          }
extent_path = g_malloc0(PATH_MAX);
-        path_combine(extent_path, sizeof(extent_path),
-                desc_file_path, fname);
+        path_combine(extent_path, PATH_MAX, desc_file_path, fname);
          extent_file = NULL;
          ret = bdrv_open(&extent_file, extent_path, NULL, NULL,
                          bs->open_flags | BDRV_O_PROTOCOL, NULL, errp);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]