]> git.ipfire.org Git - people/arne_f/kernel.git/commit
kconfig/nconf: Fix hang when editing symbol with a long prompt
authorBen Hutchings <ben.hutchings@codethink.co.uk>
Thu, 24 Nov 2016 22:10:23 +0000 (22:10 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Jan 2017 07:32:25 +0000 (08:32 +0100)
commitd024532a97db32db4b0fc4cd27c7a9ac15b84e5b
treef3145a2a08102faee003f5adb6cd129075c0bc88
parent173fd37a3d2135fcf17a3240a71ca9c79ae151ab
kconfig/nconf: Fix hang when editing symbol with a long prompt

commit 79e51b5c2deea542b3bb8c66e0d502230b017dde upstream.

Currently it is impossible to edit the value of a config symbol with a
prompt longer than (terminal width - 2) characters.  dialog_inputbox()
calculates a negative x-offset for the input window and newwin() fails
as this is invalid.  It also doesn't check for this failure, so it
busy-loops calling wgetch(NULL) which immediately returns -1.

The additions in the offset calculations also don't match the intended
size of the window.

Limit the window size and calculate the offset similarly to
show_scroll_win().

Fixes: 692d97c380c6 ("kconfig: new configuration interface (nconfig)")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
scripts/kconfig/nconf.gui.c