From d037b86561dc45ed839346caf57e74b5bafd5456 Mon Sep 17 00:00:00 2001 From: marius eriksen Date: Sun, 29 May 2005 08:46:11 +0000 Subject: robustness against malformed snames. ok henning@ --- sbin/dhclient/dhclient.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 9df56e954f4..9e9978975f2 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.67 2005/04/08 14:21:36 henning Exp $ */ +/* $OpenBSD: dhclient.c,v 1.68 2005/05/29 08:46:10 marius Exp $ */ /* * Copyright 2004 Henning Brauer @@ -949,12 +949,11 @@ packet_to_lease(struct packet *packet) } memcpy(lease->server_name, packet->raw->sname, DHCP_SNAME_LEN); lease->server_name[DHCP_SNAME_LEN]='\0'; - if (!res_hnok(lease->server_name) ) { - warning("Bogus server name %s", lease->server_name ); - free_client_lease(lease); - return (NULL); + if (!res_hnok(lease->server_name)) { + warning("Bogus server name %s", lease->server_name); + free(lease->server_name); + lease->server_name = NULL; } - } /* Ditto for the filename. */ -- cgit v1.2.3