diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-19 15:16:35 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-10-19 15:16:35 +0000 |
commit | 8d16d26334828c4f56b2712b28dbb67e851cee51 (patch) | |
tree | 1f2f8e5c86a6e1cbf7591a0234d8ac12a1790f9a /usr.sbin/dhcpd | |
parent | a12b708cc18af38c602719d1b27fdb605488f0e3 (diff) |
Ensure that main_buffer_size is set to a value less than or equal to
the size of the outgoing packet's options field. Spotted by canacar@.
ok beck@
Diffstat (limited to 'usr.sbin/dhcpd')
-rw-r--r-- | usr.sbin/dhcpd/options.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.sbin/dhcpd/options.c b/usr.sbin/dhcpd/options.c index 2006f82a53f..5ee70b04b51 100644 --- a/usr.sbin/dhcpd/options.c +++ b/usr.sbin/dhcpd/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.9 2007/10/09 03:17:34 krw Exp $ */ +/* $OpenBSD: options.c,v 1.10 2007/10/19 15:16:34 krw Exp $ */ /* DHCP options parsing and reassembly. */ @@ -238,8 +238,8 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket, else main_buffer_size = 576 - DHCP_FIXED_LEN; - if (main_buffer_size > sizeof(buffer)) - main_buffer_size = sizeof(buffer); + if (main_buffer_size > sizeof(outpacket->options)) + main_buffer_size = sizeof(outpacket->options); /* Preload the option priority list with mandatory options. */ priority_len = 0; |