diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2013-10-03 19:10:22 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2013-10-03 19:14:16 +0200 |
commit | b2ff06fc12dd755002216d7e70b98c14d8b6bfed (patch) | |
tree | f482ec6b882a527bf8e61e8df2bce6aa8cb322db | |
parent | cbe261caa24f9f58fd28cd20a811952068d7f8d2 (diff) | |
download | NetworkManager-b2ff06fc12dd755002216d7e70b98c14d8b6bfed.tar.gz |
cli: fix a possible crash when casting NULL using NM_CONNECTION (rh #1011942)
https://bugzilla.redhat.com/show_bug.cgi?id=1011942
-rw-r--r-- | cli/src/connections.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cli/src/connections.c b/cli/src/connections.c index 5bb12724ff..fd06ca5547 100644 --- a/cli/src/connections.c +++ b/cli/src/connections.c @@ -5512,7 +5512,10 @@ property_edit_submenu (NmCli *nmc, char *cmd_property_arg; /* Connection is dirty? (not saved or differs from the saved) */ - dirty = !nm_connection_compare (connection, NM_CONNECTION (rem_con), NM_SETTING_COMPARE_FLAG_EXACT); + dirty = !nm_connection_compare (connection, + rem_con ? NM_CONNECTION (rem_con) : NULL, + NM_SETTING_COMPARE_FLAG_EXACT); + if (nmc->editor_status_line) editor_show_status_line (connection, dirty); @@ -5891,7 +5894,9 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t nm_connection_get_uuid (connection)); /* Connection is dirty? (not saved or differs from the saved) */ - dirty = !nm_connection_compare (connection, NM_CONNECTION (rem_con), NM_SETTING_COMPARE_FLAG_EXACT); + dirty = !nm_connection_compare (connection, + rem_con ? NM_CONNECTION (rem_con) : NULL, + NM_SETTING_COMPARE_FLAG_EXACT); if (nmc->editor_status_line) editor_show_status_line (connection, dirty); |