LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File ntp-segfault_on_invalid_device.patch of Package ntp (Project network:time)

Index: ntpd/refclock_parse.c
===================================================================
--- ntpd/refclock_parse.c.orig
+++ ntpd/refclock_parse.c
@@ -3409,6 +3409,10 @@ parse_control(
         struct parseunit *parse = (struct parseunit *)peer->procptr->unitptr;
 	parsectl_t tmpctl;
 
+        /* If opening the clock device failed, unitptr is NULL */
+        if (!parse)
+                return;
+
 	static char outstatus[400];	/* status output buffer */
 
 	if (out)