diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-07-15 17:16:11 +0200 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-07-15 17:16:11 +0200 |
commit | 7b6299d8dd969c10ee0b5ec203d812cf9a6c7a56 (patch) | |
tree | eb8f706482debdedd62b8982eda9b29c2b0286ca /clients | |
parent | 9856ca605885068ec46a76fdcd307fd5726ffa3d (diff) | |
download | NetworkManager-7b6299d8dd969c10ee0b5ec203d812cf9a6c7a56.tar.gz |
cli: fix a crash adding a slave connection with 'nmcli -a con add'
Valid types: [generic, 802-3-ethernet (ethernet), pppoe, 802-11-wireless (wifi), wimax, gsm, cdma, infiniband, adsl, bluetooth, vpn, 802-11-olpc-mesh (olpc-mesh), vlan, bond, team, bridge, bond-slave, team-slave, bridge-slave]
Connection type: team-slave
Interface name [*]: eth5
Master: nm-team
Program received signal SIGSEGV, Segmentation fault.
0x000000000041ae6d in normalized_master_for_slave (connections=connections@entry=0x7fffec0019a0, master=<optimized out>, master@entry=0x73b470 "nm-team",
type=type@entry=0x72f7c0 "team", out_type=out_type@entry=0x0) at connections.c:3218
3218 *out_type = con_type;
Fixes: aa12bb353bca34be1bea0625c8e6e7715f24deb3
Diffstat (limited to 'clients')
-rw-r--r-- | clients/cli/connections.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c index 4af75d1cd2..c09eff9120 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -3201,7 +3201,8 @@ normalized_master_for_slave (const GPtrArray *connections, if (func) { /* There was a prefix; only compare to that type. */ if (g_strcmp0 (master, func (connection)) == 0) { - *out_type = con_type; + if (out_type) + *out_type = con_type; if (func == nm_connection_get_id) out_master = nm_connection_get_uuid (connection); else @@ -3215,7 +3216,8 @@ normalized_master_for_slave (const GPtrArray *connections, if ( g_strcmp0 (master, uuid) == 0 || g_strcmp0 (master, ifname) == 0) { out_master = master; - *out_type = con_type; + if (out_type) + *out_type = con_type; break; } if (!found_by_id && g_strcmp0 (master, id) == 0) { |