[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    Re: [PATCH] xfree86: fix VbeModeInfoBlock memcpy off-by-one (#30159)
From:       Rémi Cardona <remi () gentoo ! org>
Date:       2010-09-30 21:47:52
Message-ID: 4CA50588.80801 () gentoo ! org
[Download RAW message or body]

Le 28/09/2010 17:16, Adam Jackson a écrit :
> It's correct but it's exactly as ridiculous as the original.  How's this
> instead:

♥ !

Although...

> --- a/hw/xfree86/vbe/vbe.c
> +++ b/hw/xfree86/vbe/vbe.c
> @@ -529,67 +529,7 @@ VBEGetModeInfo(vbeInfoPtr pVbe, int mode)
>  
>      block = calloc(sizeof(VbeModeInfoBlock), 1);

... maybe this one can become a regular malloc(), since the structure is
packed and the copy covers the entire struct, there won't be any
uninitialized holes.

[...]

> +    memcpy(block, pVbe->memory, 256);

Just wondering, why not use sizeof here as well? Am I missing something?

In any case, the new patch makes a whole lot more sense than the old
code, I still can't believe it was that simple. I'll gladly update your
patch if needs be.

Reviewed-by: Rémi Cardona <remi@gentoo.org>

Cheers
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic