Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 023a7e06 authored by Ben Hutchings's avatar Ben Hutchings Committed by Sasha Levin
Browse files

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: 692d97c3 ("kconfig: new configuration interface (nconfig)")
Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
parent 6fc6cae4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment