summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dhclient.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2012-11-24 18:06:15 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2012-11-24 18:06:15 +0000
commitfcbc6cf70863a4f7958222f71957bceeaa9837db (patch)
tree888765c58622e4315aadf18e0fe3348dc7ea5f40 /sbin/dhclient/dhclient.c
parent461be7c56c861c9833802d2830a324e5f06c21a5 (diff)
Don't segfault if no subnet-mask is provided, or is marked 'ignore'
in dhclient.conf. Always zero out stack masks rather than using stack garbage when no subnet-mask is provided.
Diffstat (limited to 'sbin/dhclient/dhclient.c')
-rw-r--r--sbin/dhclient/dhclient.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index 038b74dfed6..b1820157647 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.179 2012/11/23 15:25:47 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.180 2012/11/24 18:06:14 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -666,6 +666,7 @@ bind_lease(void)
lease = apply_defaults(client->new);
options = lease->options;
+ memset(&mask, 0, sizeof(mask));
memcpy(&mask.s_addr, options[DHO_SUBNET_MASK].data,
options[DHO_SUBNET_MASK].len);
add_address(ifi->name, ifi->rdomain, client->new->address, mask);