WSL2-Linux-Kernel/scripts/kconfig
Masahiro Yamada 7a263a0402 kconfig: fix segmentation fault in menuconfig search
Since commit d05377e184 ("kconfig: Create links to main menu items
in search"), menuconfig shows a jump key next to "Main menu" if the
nearest visible parent is the rootmenu. If you press that jump key,
menuconfig crashes with a segmentation fault.

For example, do this:

  $ make ARCH=arm64 allnoconfig menuconfig

Press '/' to search for the string "ACPI". Press '1' to choose
"(1) Main menu". Then, menuconfig crashed with a segmentation fault.

The following code in search_conf()

    conf(targets[i]->parent, targets[i]);

results in NULL pointer dereference because targets[i] is the rootmenu,
which does not have a parent.

Commit d05377e184 tried to fix the issue of top-level items not having
a jump key, but adding the "Main menu" was not the right fix.

The correct fix is to show the searched item itself. This fixes another
weird behavior described in the comment block.

Fixes: d05377e184 ("kconfig: Create links to main menu items in search")
Reported-by: Johannes Zink <j.zink@pengutronix.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Bagas Sanjaya <bagasdotme@gmail.com>
Tested-by: Johannes Zink <j.zink@pengutronix.de>
2022-11-02 17:32:05 +09:00
..
lxdialog kconfig: lxdialog: A spello fix and a punctuation added 2021-04-14 15:22:49 +09:00
tests kconfig: change "modules" from sub-option to first-level attribute 2021-04-14 15:22:49 +09:00
.gitignore kconfig: refactor .gitignore 2021-04-26 02:17:39 +09:00
Makefile kconfig: Add `make mod2noconfig` to disable module options 2021-12-02 17:02:36 +09:00
conf.c Kconfig: remove sym_set_choice_value 2022-09-29 04:40:15 +09:00
confdata.c Kbuild: add Rust support 2022-09-28 09:02:20 +02:00
expr.c kconfig: distinguish between dependencies and visibility in help text 2020-01-07 02:18:45 +09:00
expr.h kconfig: remove allnoconfig_y option 2021-04-14 15:22:49 +09:00
gconf-cfg.sh kbuild: Allow kernel installation packaging to override pkg-config 2022-04-05 17:03:31 +09:00
gconf.c kconfig: highlight gconfig 'comment' lines with '***' 2021-04-19 14:57:16 +09:00
gconf.glade scripts/kconfig/gconf.glade Update broken web addresses. 2010-09-17 16:54:42 +02:00
images.c kconfig: constify XPM data 2020-08-14 13:30:03 +09:00
images.h kconfig: constify XPM data 2020-08-14 13:30:03 +09:00
internal.h kconfig: split menu.c out of parser.y 2021-04-14 15:26:09 +09:00
lexer.l kconfig: rename a variable in the lexer to a clearer name 2021-09-30 02:08:59 +09:00
list.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
lkc.h Kconfig: remove sym_set_choice_value 2022-09-29 04:40:15 +09:00
lkc_proto.h kconfig: move sym_escape_string_value() to confdata.c 2021-10-11 23:13:23 +09:00
mconf-cfg.sh kbuild: Allow kernel installation packaging to override pkg-config 2022-04-05 17:03:31 +09:00
mconf.c kconfig: mconf,nconf: remove unneeded '\0' termination after snprintf() 2021-04-14 15:22:49 +09:00
menu.c kconfig: fix segmentation fault in menuconfig search 2022-11-02 17:32:05 +09:00
merge_config.sh scripts: merge_config: add strict mode to fail upon any redefinition 2021-08-10 08:23:39 +09:00
nconf-cfg.sh kbuild: Allow kernel installation packaging to override pkg-config 2022-04-05 17:03:31 +09:00
nconf.c scripts: kconfig: nconf: make nconfig accept jk keybindings 2022-06-05 06:20:57 +09:00
nconf.gui.c kconfig: nconf: refactor in print_in_middle() 2021-04-14 15:25:43 +09:00
nconf.h kconfig: nconf: refactor in print_in_middle() 2021-04-14 15:25:43 +09:00
parser.y kconfig: split menu.c out of parser.y 2021-04-14 15:26:09 +09:00
preprocess.c kconfig: let 'shell' return enough output for deep path names 2022-02-08 13:20:11 +09:00
qconf-cfg.sh kconfig: Qt5: tell the user which packages are required 2022-07-27 21:18:00 +09:00
qconf.cc kconfig: highlight xconfig 'comment' lines with '***' 2021-04-19 14:58:23 +09:00
qconf.h kconfig: qconf: remove Y, M, N columns 2020-09-25 00:37:13 +09:00
streamline_config.pl streamline_config.pl: show the full Kconfig name 2021-12-02 17:02:36 +09:00
symbol.c kconfig: move sym_escape_string_value() to confdata.c 2021-10-11 23:13:23 +09:00
util.c kconfig: convert to SPDX License Identifier 2018-12-28 22:22:28 +09:00