diff options
| author | Jiří Klimeš <jklimes@redhat.com> | 2014-06-06 18:22:06 +0200 |
|---|---|---|
| committer | Jiří Klimeš <jklimes@redhat.com> | 2014-06-06 18:30:45 +0200 |
| commit | 3ef79ee2492475b213bcdf070a1f7207d4e58b64 (patch) | |
| tree | 891ea7f82692519bc508860b9072b73b752db3bf /src/devices/nm-device-bridge.c | |
| parent | ab1a0155793bb31935739866d8acc37faefff6d2 (diff) | |
| download | NetworkManager-3ef79ee2492475b213bcdf070a1f7207d4e58b64.tar.gz | |
device: don't call strtol() for NULL strings
#1 0x0000003c47239ea2 in __GI_strtol (nptr=nptr@entry=0x0, endptr=endptr@entry=0x0, base=base@entry=10) at ../stdlib/strtol.c:110
#2 0x000000000043b896 in update_connection (device=<optimized out>, connection=<optimized out>) at devices/nm-device-bridge.c:308
#3 0x000000000042ed2f in nm_device_generate_connection (device=device@entry=0xfbb260 [NMDeviceBridge]) at devices/nm-device.c:1644
#4 0x0000000000481613 in get_existing_connection (device=0xfbb260 [NMDeviceBridge], manager=0xfb2000 [NMManager]) at nm-manager.c:1549
#5 add_device (self=self@entry=0xfb2000 [NMManager], device=device@entry=0xfbb260 [NMDeviceBridge], generate_con=<optimized out>)
at nm-manager.c:1688
#6 0x0000000000481f50 in platform_link_added (plink=0x7fffffffdd50, ifindex=695, self=0xfb2000 [NMManager], reason=<optimized out>)
at nm-manager.c:2023
#7 platform_link_cb (platform=<optimized out>, ifindex=695, plink=0x7fffffffdd50, change_type=<optimized out>, reason=<optimized out>,
user_data=<optimized out>) at nm-manager.c:2038
Diffstat (limited to 'src/devices/nm-device-bridge.c')
| -rw-r--r-- | src/devices/nm-device-bridge.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c index 5c99c0e998..edc41838fb 100644 --- a/src/devices/nm-device-bridge.c +++ b/src/devices/nm-device-bridge.c @@ -305,13 +305,20 @@ update_connection (NMDevice *device, NMConnection *connection) for (option = master_options; option->name; option++) { gs_free char *str = nm_platform_master_get_option (ifindex, option->sysname); - int value = strtol (str, NULL, 10); + int value; - /* See comments in set_sysfs_uint() about centiseconds. */ - if (option->user_hz_compensate) - value /= 100; + if (str) { + value = strtol (str, NULL, 10); + + /* See comments in set_sysfs_uint() about centiseconds. */ + if (option->user_hz_compensate) + value /= 100; - g_object_set (s_bridge, option->name, value, NULL); + g_object_set (s_bridge, option->name, value, NULL); + } else { + nm_log_warn (LOGD_BRIDGE, "(%s): failed to read bridge setting '%s'", + nm_device_get_iface (device), option->sysname); + } } } |
