From: Ted Lemon Date: Fri, 26 Jun 1998 04:17:12 +0000 (+0000) Subject: Fix possible null pointer dereference. Remove newlines from "reclaimed" syslog... X-Git-Tag: V2-BETA-1-PATCH-3~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6b8e11e8b26ddf78959407b5fb07cf9bd7e4de9e;p=thirdparty%2Fdhcp.git Fix possible null pointer dereference. Remove newlines from "reclaimed" syslog messages. --- diff --git a/server/dhcp.c b/server/dhcp.c index 8c94b88a1..7387e4659 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -42,7 +42,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.57.2.4 1998/06/25 22:12:05 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.57.2.5 1998/06/26 04:17:12 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998 The Internet Software Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -120,7 +120,7 @@ void dhcpdiscover (packet) warning message, so that if it continues to lose, the administrator will eventually investigate. */ if (lease -> flags & ABANDONED_LEASE) { - warn ("Reclaiming abandoned IP address %s.\n", + warn ("Reclaiming abandoned IP address %s.", piaddr (lease -> ip_addr)); lease -> flags &= ~ABANDONED_LEASE; } @@ -1391,8 +1391,8 @@ struct lease *find_lease (packet, share, ours) /* If we find an abandoned lease, take it, but print a warning message, so that if it continues to lose, the administrator will eventually investigate. */ - if (lease -> flags & ABANDONED_LEASE) { - warn ("Reclaiming REQUESTed abandoned IP address %s.\n", + if (lease && lease -> flags & ABANDONED_LEASE) { + warn ("Reclaiming REQUESTed abandoned IP address %s.", piaddr (lease -> ip_addr)); lease -> flags &= ~ABANDONED_LEASE; }