summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarius eriksen <marius@cvs.openbsd.org>2005-05-29 08:46:11 +0000
committermarius eriksen <marius@cvs.openbsd.org>2005-05-29 08:46:11 +0000
commitd037b86561dc45ed839346caf57e74b5bafd5456 (patch)
tree26d74a01c805bc351ad3456746b862105e8af1fc
parentfae4aa47e171ba097e8a9ac89edcc9d2f81b3c62 (diff)
robustness against malformed snames.
ok henning@
-rw-r--r--sbin/dhclient/dhclient.c11
1 files 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 <henning@openbsd.org>
@@ -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. */