]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerSasha Levin <alexander.levin@verizon.com>
Fri, 13 Jan 2017 01:56:57 +0000 (20:56 -0500)
commit0848a2672eb3a9be93b6eb0c28e7c161f465ca97
tree89baf1bdec3b8f44ce8c093038d4ddbae09f19a6
parent7b53fb41d44765193a0e3211d42a96dd9cf0b92d
kconfig/nconf: Fix hang when editing symbol with a long prompt

[ Upstream commit 79e51b5c2deea542b3bb8c66e0d502230b017dde ]

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().

Cc: stable <stable@vger.kernel.org>
Fixes: 692d97c380c6 ("kconfig: new configuration interface (nconfig)")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
scripts/kconfig/nconf.gui.c