From 30848b8dd73cef8a7ffdd7e7d3a16980c9a99964 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 4 Dec 2017 14:56:07 +0000 Subject: [PATCH] Avoid a NULL-deref in get_recorded_lease() leading to a segfault seen by aja and others. ok krw --- sbin/dhclient/dhclient.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 1a41f97ac9f..664ea2bab73 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.532 2017/12/03 20:53:28 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.533 2017/12/04 14:56:07 tb Exp $ */ /* * Copyright 2004 Henning Brauer @@ -2541,7 +2541,7 @@ get_recorded_lease(struct interface_info *ifi) break; } - if (lp->epoch == 0) + if (lp && lp->epoch == 0) time(&lp->epoch); return lp; -- 2.20.1