summaryrefslogtreecommitdiff
path: root/sbin/dhclient/privsep.c
diff options
context:
space:
mode:
authorChad Loder <cloder@cvs.openbsd.org>2005-06-02 15:04:26 +0000
committerChad Loder <cloder@cvs.openbsd.org>2005-06-02 15:04:26 +0000
commita85e4e75702572a5ce69f9e626b81fba39713881 (patch)
treea4678a07f27b15dd82f71ba81f5896074581a77f /sbin/dhclient/privsep.c
parent456706b3605f46602a6cf2e4fdfca609a7d2fc69 (diff)
Make buf_add a no-op if length == 0. OK henning
Diffstat (limited to 'sbin/dhclient/privsep.c')
-rw-r--r--sbin/dhclient/privsep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sbin/dhclient/privsep.c b/sbin/dhclient/privsep.c
index cf47e56ceb6..83a4112a5d1 100644
--- a/sbin/dhclient/privsep.c
+++ b/sbin/dhclient/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.7 2004/05/10 18:34:42 deraadt Exp $ */
+/* $OpenBSD: privsep.c,v 1.8 2005/06/02 15:04:25 cloder Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
@@ -38,6 +38,9 @@ buf_open(size_t len)
int
buf_add(struct buf *buf, void *data, size_t len)
{
+ if (len == 0)
+ return (0);
+
if (buf->wpos + len > buf->size)
return (-1);