Commit 7a263a0
committed
kconfig: fix segmentation fault in menuconfig search
Since commit d05377e ("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 d05377e 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: d05377e ("kconfig: Create links to main menu items in search")
Reported-by: Johannes Zink <[email protected]>
Signed-off-by: Masahiro Yamada <[email protected]>
Tested-by: Bagas Sanjaya <[email protected]>
Tested-by: Johannes Zink <[email protected]>1 parent fb3041d commit 7a263a0
File tree
1 file changed
+4
-19
lines changed- scripts/kconfig
1 file changed
+4
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
722 | 722 | | |
723 | 723 | | |
724 | 724 | | |
725 | | - | |
726 | | - | |
| 725 | + | |
| 726 | + | |
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
| 736 | + | |
746 | 737 | | |
747 | 738 | | |
748 | 739 | | |
| |||
758 | 749 | | |
759 | 750 | | |
760 | 751 | | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
| 752 | + | |
768 | 753 | | |
769 | 754 | | |
770 | 755 | | |
| |||
0 commit comments