From: Thomas Hebb <tommyhebb@gmail.com>
To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Cc: Thomas Hebb <tommyhebb@gmail.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>
Subject: [PATCH 2/4] kconfig: don't crash on NULL expressions in expr_eq()
Date: Mon, 9 Dec 2019 00:19:17 -0800 [thread overview]
Message-ID: <2f42719235f9250ed10209982543f99f4fd41d61.1575879069.git.tommyhebb@gmail.com> (raw)
In-Reply-To: <cover.1575879069.git.tommyhebb@gmail.com>
NULL expressions are taken to always be true, as implemented by the
expr_is_yes() macro and by several other functions in expr.c. As such,
they ought to be valid inputs to expr_eq(), which compares two
expressions.
Signed-off-by: Thomas Hebb <tommyhebb@gmail.com>
---
scripts/kconfig/expr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index 77ffff3a053c..8284444cc3fa 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -254,6 +254,11 @@ static int expr_eq(struct expr *e1, struct expr *e2)
{
int res, old_count;
+ /* A NULL expr is taken to be yes, but there's also a different way to
+ * represent yes. expr_is_yes() checks for either representation. */
+ if (!e1 || !e2)
+ return expr_is_yes(e1) && expr_is_yes(e2);
+
if (e1->type != e2->type)
return 0;
switch (e1->type) {
--
2.24.0
next prev parent reply other threads:[~2019-12-09 8:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 8:19 [PATCH 0/4] kconfig: rework symbol help text Thomas Hebb
2019-12-09 8:19 ` [PATCH 1/4] kconfig: list all definitions of a symbol in " Thomas Hebb
2019-12-09 8:19 ` Thomas Hebb
2019-12-09 8:19 ` Thomas Hebb
2019-12-16 4:49 ` Masahiro Yamada
2019-12-16 4:49 ` Masahiro Yamada
2019-12-09 8:19 ` Thomas Hebb [this message]
2019-12-17 10:20 ` [PATCH 2/4] kconfig: don't crash on NULL expressions in expr_eq() Masahiro Yamada
2019-12-09 8:19 ` [PATCH 3/4] kconfig: distinguish between dependencies and visibility in help text Thomas Hebb
2019-12-16 4:50 ` Masahiro Yamada
2019-12-09 8:19 ` [PATCH 4/4] kconfig: fix nesting of symbol " Thomas Hebb
2019-12-16 4:57 ` [PATCH 0/4] kconfig: rework " Masahiro Yamada
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=2f42719235f9250ed10209982543f99f4fd41d61.1575879069.git.tommyhebb@gmail.com \
--to=tommyhebb@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yamada.masahiro@socionext.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.