diff options
author | 2016-09-12 01:22:38 +0000 | |
---|---|---|
committer | 2016-09-12 01:22:38 +0000 | |
commit | 03db5a1fc0783eca74421987577021fff7765a76 (patch) | |
tree | 21dc6070bbad3e468302e04c7ccee22750ab3a95 /usr.bin/ssh/sshbuf.c | |
parent | document that running a W^X violating binary from file system mounted (diff) | |
download | wireguard-openbsd-03db5a1fc0783eca74421987577021fff7765a76.tar.xz wireguard-openbsd-03db5a1fc0783eca74421987577021fff7765a76.zip |
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
Diffstat (limited to 'usr.bin/ssh/sshbuf.c')
-rw-r--r-- | usr.bin/ssh/sshbuf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/ssh/sshbuf.c b/usr.bin/ssh/sshbuf.c index 5b122ebc111..9be20028a2d 100644 --- a/usr.bin/ssh/sshbuf.c +++ b/usr.bin/ssh/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 * @@ -15,7 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include <sys/param.h> /* roundup */ #include <sys/types.h> #include <signal.h> #include <stdlib.h> @@ -25,6 +24,7 @@ #include "ssherr.h" #define SSHBUF_INTERNAL #include "sshbuf.h" +#include "misc.h" static inline int sshbuf_check_sanity(const struct sshbuf *buf) @@ -248,7 +248,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); @@ -338,7 +338,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; |