From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Cc: jbe@pengutronix.de
Subject: [PATCH] blspec: Fix crash with menu disabled
Date: Wed, 30 Oct 2013 11:37:55 +0100 [thread overview]
Message-ID: <1383129475-20448-1-git-send-email-s.hauer@pengutronix.de> (raw)
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);
}
--
1.8.4.rc3
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next reply other threads:[~2013-10-30 10:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-30 10:37 Sascha Hauer [this message]
2013-10-30 11:05 ` Jürgen Beisert
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=1383129475-20448-1-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=jbe@pengutronix.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