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:
@@ -4580,7 +4580,9 @@ ask_check_property (const char *arg,
|
|||||||
|
|
||||||
if (!arg) {
|
if (!arg) {
|
||||||
printf (_("Available properties: %s\n"), valid_props_str);
|
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
|
} else
|
||||||
prop_name_user = g_strdup (arg);
|
prop_name_user = g_strdup (arg);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user