diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c index 1106f067..75cdff3b 100644 --- a/src/lib/libc/crypt/arc4random.c +++ b/src/lib/libc/crypt/arc4random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.51 2015/01/15 06:57:18 deraadt Exp $ */ +/* $OpenBSD: arc4random.c,v 1.52 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -31,7 +31,6 @@ #include #include #include -#include #include #define KEYSTREAM_ONLY diff --git a/src/lib/libc/crypt/crypt.c b/src/lib/libc/crypt/crypt.c index c7ff5d97..7d21d4fb 100644 --- a/src/lib/libc/crypt/crypt.c +++ b/src/lib/libc/crypt/crypt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypt.c,v 1.25 2014/12/08 20:36:18 tedu Exp $ */ +/* $OpenBSD: crypt.c,v 1.26 2015/01/16 16:48:51 deraadt Exp $ */ /* * FreeSec: libcrypt @@ -47,7 +47,6 @@ */ #include -#include #include #include #include diff --git a/src/lib/libc/hash/helper.c b/src/lib/libc/hash/helper.c index c13ce461..ee174176 100644 --- a/src/lib/libc/hash/helper.c +++ b/src/lib/libc/hash/helper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: helper.c,v 1.12 2015/01/15 13:05:59 millert Exp $ */ +/* $OpenBSD: helper.c,v 1.13 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp @@ -21,7 +21,7 @@ * can buy me a beer in return. Poul-Henning Kamp */ -#include +#include #include #include @@ -33,6 +33,8 @@ #include +#define MINIMUM(a, b) (((a) < (b)) ? (a) : (b)) + /* ARGSUSED */ char * HASHEnd(HASH_CTX *ctx, char *buf) @@ -79,7 +81,7 @@ HASHFileChunk(const char *filename, char *buf, off_t off, off_t len) return (NULL); } - while ((nr = read(fd, buffer, MIN(sizeof(buffer), len))) > 0) { + while ((nr = read(fd, buffer, MINIMUM(sizeof(buffer), len))) > 0) { HASHUpdate(&ctx, buffer, (size_t)nr); if (len > 0 && (len -= nr) == 0) break; diff --git a/src/lib/libc/hash/sha1.c b/src/lib/libc/hash/sha1.c index d4843450..fbaab9ba 100644 --- a/src/lib/libc/hash/sha1.c +++ b/src/lib/libc/hash/sha1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sha1.c,v 1.24 2015/01/15 13:05:59 millert Exp $ */ +/* $OpenBSD: sha1.c,v 1.25 2015/01/16 16:48:51 deraadt Exp $ */ /* * SHA-1 in C @@ -14,7 +14,7 @@ * 34AA973C D4C4DAA4 F61EEB2B DBAD2731 6534016F */ -#include +#include #include #include diff --git a/src/lib/libc/hash/siphash.c b/src/lib/libc/hash/siphash.c index 81b4b818..dcc746a9 100644 --- a/src/lib/libc/hash/siphash.c +++ b/src/lib/libc/hash/siphash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siphash.c,v 1.1 2014/12/08 20:37:11 tedu Exp $ */ +/* $OpenBSD: siphash.c,v 1.2 2015/01/16 16:48:51 deraadt Exp $ */ /*- * Copyright (c) 2013 Andre Oppermann @@ -43,7 +43,7 @@ * https://131002.net/siphash/ */ -#include +#include #include #include diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 57d35b80..69ae877a 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.172 2015/01/05 21:04:04 tedu Exp $ */ +/* $OpenBSD: malloc.c,v 1.173 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2008, 2010, 2011 Otto Moerbeek * Copyright (c) 2012 Matthew Dempsky @@ -26,7 +26,7 @@ /* #define MALLOC_STATS */ #include -#include +#include /* PAGE_SHIFT ALIGN */ #include #include #include diff --git a/src/lib/libc/stdlib/random.c b/src/lib/libc/stdlib/random.c index 96cced9a..e293648e 100644 --- a/src/lib/libc/stdlib/random.c +++ b/src/lib/libc/stdlib/random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: random.c,v 1.28 2014/12/16 20:51:32 sthen Exp $ */ +/* $OpenBSD: random.c,v 1.29 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. @@ -28,9 +28,6 @@ * SUCH DAMAGE. */ -#include -#include -#include #include #include #include diff --git a/src/lib/libc/stdlib/realpath.c b/src/lib/libc/stdlib/realpath.c index e06db590..7b70b9dd 100644 --- a/src/lib/libc/stdlib/realpath.c +++ b/src/lib/libc/stdlib/realpath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: realpath.c,v 1.18 2014/10/19 03:56:28 doug Exp $ */ +/* $OpenBSD: realpath.c,v 1.19 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 2003 Constantin S. Svintsoff * @@ -27,13 +27,13 @@ * SUCH DAMAGE. */ -#include #include #include #include #include #include +#include /* A slightly modified copy of this file exists in libexec/ld.so */ @@ -156,7 +156,7 @@ realpath(const char *path, char *resolved) goto err; } if (S_ISLNK(sb.st_mode)) { - if (symlinks++ > MAXSYMLINKS) { + if (symlinks++ > SYMLOOP_MAX) { errno = ELOOP; goto err; } diff --git a/src/lib/libutil/readlabel.c b/src/lib/libutil/readlabel.c index 1260d7b2..e2cee311 100644 --- a/src/lib/libutil/readlabel.c +++ b/src/lib/libutil/readlabel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readlabel.c,v 1.12 2014/06/30 00:25:37 deraadt Exp $ */ +/* $OpenBSD: readlabel.c,v 1.13 2015/01/16 16:48:52 deraadt Exp $ */ /* * Copyright (c) 1996, Jason Downs. All rights reserved. @@ -25,7 +25,7 @@ * SUCH DAMAGE. */ -#include +#include #include #include #define DKTYPENAMES @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -49,7 +50,7 @@ char * readlabelfs(char *device, int verbose) { - char rpath[MAXPATHLEN]; + char rpath[PATH_MAX]; struct dk_diskmap dm; struct disklabel dk; char part, *type;