[systemd-devel] [PATCH] networkd: link - avoid null pointer deref

Thomas H.P. Andersen phomes at gmail.com
Fri Jun 13 14:52:00 PDT 2014


From: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>

---
 src/network/networkd-link.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index baa0756..39c8329 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -2161,8 +2161,8 @@ int link_save(Link *link) {
                         "DHCP_USE_DNS=%s\n"
                         "DHCP_USE_NTP=%s\n",
                         link->lease_file,
-                        yes_no(link->network->dhcp_dns),
-                        yes_no(link->network->dhcp_ntp));
+                        yes_no(link->network && link->network->dhcp_dns),
+                        yes_no(link->network && link->network->dhcp_ntp));
         } else
                 unlink(link->lease_file);
 
-- 
1.9.3



More information about the systemd-devel mailing list