summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-08-16 15:40:08 +0200
committerThomas Haller <thaller@redhat.com>2016-08-17 13:14:08 +0200
commit42a35d3309f55920c9b3c1626e1118c0e7dab227 (patch)
tree6ca216aaa2a8573b3fa8c3cd8825d0ef8f3b4721
parentb9e89c918f13374772a72cefbe0cda6bb6bc88e4 (diff)
downloadNetworkManager-42a35d3309f55920c9b3c1626e1118c0e7dab227.tar.gz
device: copy the plink instance before realize_start_setup()
To make sure, we don't end up with a dangling pointer due to an intermediate platform access which may invalidate the pointer.
-rw-r--r--src/devices/nm-device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 177080d9c5..9c7319f03d 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -1955,6 +1955,8 @@ nm_device_realize_start (NMDevice *self,
gboolean *out_compatible,
GError **error)
{
+ NMPlatformLink plink_copy;
+
NM_SET_OUT (out_compatible, TRUE);
if (plink) {
@@ -1969,6 +1971,10 @@ nm_device_realize_start (NMDevice *self,
return FALSE;
}
+ if (plink) {
+ plink_copy = *plink;
+ plink = &plink_copy;
+ }
realize_start_setup (self, plink);
return TRUE;