bond: fix crash in update_connection()

The value read from sysfs can be NULL.

Fixes: 2324410a75
This commit is contained in:
Beniamino Galvani 2017-02-07 11:05:01 +01:00
parent 029784b1cc
commit 0683ad5db2

View file

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