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:
Thomas Haller
2013-09-05 13:59:51 +02:00
parent 4e09b87d54
commit 1111dbf812

View File

@@ -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);