diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2017-02-07 11:05:01 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2017-02-07 11:05:01 +0100 |
commit | 0683ad5db2f1cb1237b1781d4a3b0b666f6dea9b (patch) | |
tree | 4c323cf0498efa3351f05d29543b75b9dc8504d7 | |
parent | 029784b1ccdc208513aaf1fca76636d473d200ba (diff) | |
download | NetworkManager-0683ad5db2f1cb1237b1781d4a3b0b666f6dea9b.tar.gz |
bond: fix crash in update_connection()
The value read from sysfs can be NULL.
Fixes: 2324410a75dda09d4c46362d29fb84048bfe9fcd
-rw-r--r-- | src/devices/nm-device-bond.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c index 5dba19d91c..34d34eb43b 100644 --- a/src/devices/nm-device-bond.c +++ b/src/devices/nm-device-bond.c @@ -169,7 +169,8 @@ update_connection (NMDevice *device, NMConnection *connection) const char *defvalue = nm_setting_bond_get_option_default (s_bond, *options); char *p; - if (_nm_setting_bond_get_option_type (s_bond, *options) == NM_BOND_OPTION_TYPE_BOTH) { + if ( value + && _nm_setting_bond_get_option_type (s_bond, *options) == NM_BOND_OPTION_TYPE_BOTH) { p = strchr (value, ' '); if (p) *p = '\0'; |