mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 04:20:23 +01:00
nmcli: fix segfault in edit mode when parsing user prompt
readline_x returns NULL for empty input, so it is wrong to call g_strstrip without checking for NULL first. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
4e09b87d54
commit
1111dbf812
1 changed files with 3 additions and 1 deletions
|
|
@ -4580,7 +4580,9 @@ ask_check_property (const char *arg,
|
|||
|
||||
if (!arg) {
|
||||
printf (_("Available properties: %s\n"), valid_props_str);
|
||||
prop_name_user = g_strstrip (readline_x (EDITOR_PROMPT_PROPERTY));
|
||||
prop_name_user = readline_x (EDITOR_PROMPT_PROPERTY);
|
||||
if (prop_name_user)
|
||||
g_strstrip (prop_name_user);
|
||||
} else
|
||||
prop_name_user = g_strdup (arg);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue