mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Jürgen Beisert" <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Re: [PATCH] blspec: Fix crash with menu disabled
Date: Wed, 30 Oct 2013 12:05:51 +0100	[thread overview]
Message-ID: <201310301205.51054.jbe@pengutronix.de> (raw)
In-Reply-To: <1383129475-20448-1-git-send-email-s.hauer@pengutronix.de>

On Wednesday 30 October 2013 11:37:55 Sascha Hauer wrote:
> blspec->menu is only valid when menu support is enabled. Check for it
> before dereferencing the pointer.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  include/blspec.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/blspec.h b/include/blspec.h
> index 8422e5b..aa836e6 100644
> --- a/include/blspec.h
> +++ b/include/blspec.h
> @@ -84,7 +84,8 @@ static inline void blspec_free(struct blspec *blspec)
>
>  	list_for_each_entry_safe(entry, tmp, &blspec->entries, list)
>  		blspec_entry_free(entry);
> -	free(blspec->menu->display);
> +	if (blspec->menu)
> +		free(blspec->menu->display);
>  	free(blspec->menu);
>  	free(blspec);
>  }

Tested-by: Juergen Beisert <jbe@pengutronix.de>

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |

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

      reply	other threads:[~2013-10-30 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 10:37 Sascha Hauer
2013-10-30 11:05 ` Jürgen Beisert [this message]

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=201310301205.51054.jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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