mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Daniel Mierswa <d.mierswa@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 4/4] video/imx: always initialize offscreenbuf member
Date: Thu, 17 Jan 2013 12:56:25 +0100	[thread overview]
Message-ID: <20130117115625.GE22953@game.jcrosoft.org> (raw)
In-Reply-To: <6bf1089855588c8d227009989b54c826ac8e245e.1358400153.git.d.mierswa@phytec.de>

On 07:32 Thu 17 Jan     , Daniel Mierswa wrote:
> If offscreen was not passed to fd_open the resulting offscreenbuf
> member was a dangling pointer and the free() call in fd_close
> would result in undefined behaviour.
> 
> Signed-off-by: Daniel Mierswa <d.mierswa@phytec.de>
> ---
>  commands/splash.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/commands/splash.c b/commands/splash.c
> index 4cc463e..75c7074 100644
> --- a/commands/splash.c
> +++ b/commands/splash.c
> @@ -59,6 +59,14 @@ static int do_splash(int argc, char *argv[])
>  		return 1;
>  	}
>  
> +	/*
> +	 * sc.offscreenbuf is dangling here, if no offscreen buffer was
> +	 * requested, so set it to NULL otherwise the free in fd_close
> +	 * will cause undefined behaviour
> +	 */
> +	if (!offscreen)
> +		sc.offscreenbuf = NULL;
> +
NAck

this is already done by memset

Best Regards,
J.
>  	if (sc.offscreenbuf) {
>  		if (do_bg)
>  			memset_pixel(&info, sc.offscreenbuf, bg_color,
> -- 
> 1.8.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-01-17 11:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17  6:32 [RESEND PATCH] framebuffer work (especially i.MX) Daniel Mierswa
2013-01-17  6:32 ` [PATCH 1/4] i.MX21: Add periph. clock register name macros Daniel Mierswa
2013-01-17  6:32 ` [PATCH 2/4] i.MX21/27: don't enable lcd bus clocks too early Daniel Mierswa
2013-01-17  6:32 ` [PATCH 3/4] i.MX27: fix shift amount for PCCR1_PERCLK3_EN Daniel Mierswa
2013-01-17  6:32 ` [PATCH 4/4] video/imx: always initialize offscreenbuf member Daniel Mierswa
2013-01-17 11:56   ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-01-17 13:04     ` Daniel Mierswa
2013-01-17 17:55       ` Sascha Hauer
2013-01-18  4:24         ` Daniel Mierswa
2013-01-18 10:23 ` [RESEND PATCH] framebuffer work (especially i.MX) Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130117115625.GE22953@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=d.mierswa@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox