qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error
@ 2015-02-10 18:22 Jeff Cody
  2015-02-10 21:10 ` Eric Blake
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jeff Cody @ 2015-02-10 18:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, pbonzini, famz, stefanha

The size compared should be PATH_MAX, rather than sizeof(char *).

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

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);
-- 
1.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error
  2015-02-10 18:22 [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error Jeff Cody
@ 2015-02-10 21:10 ` Eric Blake
  2015-02-10 21:42 ` Max Reitz
  2015-02-12 17:15 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2015-02-10 21:10 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, pbonzini, famz, stefanha

[-- Attachment #1: Type: text/plain, Size: 1094 bytes --]

On 02/10/2015 11:22 AM, Jeff Cody wrote:
> The size compared should be PATH_MAX, rather than sizeof(char *).
> 
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  block/vmdk.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> 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);
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error
  2015-02-10 18:22 [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error Jeff Cody
  2015-02-10 21:10 ` Eric Blake
@ 2015-02-10 21:42 ` Max Reitz
  2015-02-12 17:15 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Max Reitz @ 2015-02-10 21:42 UTC (permalink / raw)
  To: Jeff Cody, qemu-devel; +Cc: kwolf, pbonzini, famz, stefanha

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 <pbonzini@redhat.com>
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>   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 <mreitz@redhat.com>

> 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);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error
  2015-02-10 18:22 [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error Jeff Cody
  2015-02-10 21:10 ` Eric Blake
  2015-02-10 21:42 ` Max Reitz
@ 2015-02-12 17:15 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2015-02-12 17:15 UTC (permalink / raw)
  To: Jeff Cody; +Cc: kwolf, pbonzini, famz, qemu-devel, stefanha

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

On Tue, Feb 10, 2015 at 01:22:56PM -0500, Jeff Cody wrote:
> The size compared should be PATH_MAX, rather than sizeof(char *).
> 
> Reported-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  block/vmdk.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-12 17:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-10 18:22 [Qemu-devel] [PATCH] block: vmdk - fixed sizeof() error Jeff Cody
2015-02-10 21:10 ` Eric Blake
2015-02-10 21:42 ` Max Reitz
2015-02-12 17:15 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).