From 0683ad5db2f1cb1237b1781d4a3b0b666f6dea9b Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Tue, 7 Feb 2017 11:05:01 +0100 Subject: [PATCH] bond: fix crash in update_connection() The value read from sysfs can be NULL. Fixes: 2324410a75dda09d4c46362d29fb84048bfe9fcd --- src/devices/nm-device-bond.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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';