summaryrefslogtreecommitdiff
path: root/sshbuf.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2016-09-12 01:22:38 +0000
committerDarren Tucker <dtucker@zip.com.au>2016-09-12 13:46:29 +1000
commit9136ec134c97a8aff2917760c03134f52945ff3c (patch)
treebfcab357e6e0f510d9b63bac43b18097e89fa58a /sshbuf.c
parentf219fc8f03caca7ac82a38ed74bbd6432a1195e7 (diff)
downloadopenssh-git-9136ec134c97a8aff2917760c03134f52945ff3c.tar.gz
upstream commit
Add MAXIMUM(), MINIMUM(), and ROUNDUP() to misc.h, then use those definitions rather than pulling <sys/param.h> and unknown namespace pollution. ok djm markus dtucker Upstream-ID: 712cafa816c9f012a61628b66b9fbd5687223fb8
Diffstat (limited to 'sshbuf.c')
-rw-r--r--sshbuf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sshbuf.c b/sshbuf.c
index 4d6e0ea0..91cbd067 100644
--- a/sshbuf.c
+++ b/sshbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshbuf.c,v 1.6 2016/01/12 23:42:54 djm Exp $ */
+/* $OpenBSD: sshbuf.c,v 1.7 2016/09/12 01:22:38 deraadt Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
@@ -18,7 +18,6 @@
#define SSHBUF_INTERNAL
#include "includes.h"
-#include <sys/param.h> /* roundup */
#include <sys/types.h>
#include <signal.h>
#include <stdlib.h>
@@ -27,6 +26,7 @@
#include "ssherr.h"
#include "sshbuf.h"
+#include "misc.h"
static inline int
sshbuf_check_sanity(const struct sshbuf *buf)
@@ -250,7 +250,7 @@ sshbuf_set_max_size(struct sshbuf *buf, size_t max_size)
if (buf->size < SSHBUF_SIZE_INIT)
rlen = SSHBUF_SIZE_INIT;
else
- rlen = roundup(buf->size, SSHBUF_SIZE_INC);
+ rlen = ROUNDUP(buf->size, SSHBUF_SIZE_INC);
if (rlen > max_size)
rlen = max_size;
explicit_bzero(buf->d + buf->size, buf->alloc - buf->size);
@@ -340,7 +340,7 @@ sshbuf_reserve(struct sshbuf *buf, size_t len, u_char **dpp)
* allocate less if doing so would overflow max_size.
*/
need = len + buf->size - buf->alloc;
- rlen = roundup(buf->alloc + need, SSHBUF_SIZE_INC);
+ rlen = ROUNDUP(buf->alloc + need, SSHBUF_SIZE_INC);
SSHBUF_DBG(("need %zu initial rlen %zu", need, rlen));
if (rlen > buf->max_size)
rlen = buf->alloc + need;