diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2014-07-28 16:45:36 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2014-07-28 16:45:36 +0000 |
commit | 2a54eef6ba2d9aa4e66ed05adfbcdda04a70bb24 (patch) | |
tree | bac03aa13f45e13277909cd60279aa231f9544b5 /sbin | |
parent | 2b9107f677b7b8d389ae710b7e4ce5baf6f34a68 (diff) |
Fix memory exhaustion occurring on DHCP options with 0 length.
halex@ and krw@ pointed out that a NULL check before free can go, too.
ok deraadt@, halex@, krw@
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/options.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sbin/dhclient/options.c b/sbin/dhclient/options.c index 3ed71586c9b..39e76a10726 100644 --- a/sbin/dhclient/options.c +++ b/sbin/dhclient/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.69 2014/07/09 12:55:31 krw Exp $ */ +/* $OpenBSD: options.c,v 1.70 2014/07/28 16:45:35 tobias Exp $ */ /* DHCP options parsing and reassembly. */ @@ -610,6 +610,5 @@ do_packet(unsigned int from_port, struct in_addr from, free(info); for (i = 0; i < 256; i++) - if (options[i].len && options[i].data) - free(options[i].data); + free(options[i].data); } |