summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2015-01-15 22:21:01 +0000
committertedu <tedu@openbsd.org>2015-01-15 22:21:01 +0000
commitf30a54aae12916ff52b0e07997cb9c317fbf3574 (patch)
tree5e596bbe9d29d185445e269d2fd5fd6afd35383a
parentIf some mythical system lacks PATH_MAX, do not set it to MAXPATHLEN+1 (diff)
downloadwireguard-openbsd-f30a54aae12916ff52b0e07997cb9c317fbf3574.tar.xz
wireguard-openbsd-f30a54aae12916ff52b0e07997cb9c317fbf3574.zip
use PATH_MAX for path buffers. in case, you know...
-rw-r--r--usr.bin/signify/signify.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/signify/signify.c b/usr.bin/signify/signify.c
index 861bbac82dd..7ef990d9ad7 100644
--- a/usr.bin/signify/signify.c
+++ b/usr.bin/signify/signify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: signify.c,v 1.97 2015/01/09 21:49:59 tedu Exp $ */
+/* $OpenBSD: signify.c,v 1.98 2015/01/15 22:21:01 tedu Exp $ */
/*
* Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
*
@@ -19,6 +19,7 @@
#include <netinet/in.h>
#include <resolv.h>
+#include <limits.h>
#include <stdint.h>
#include <fcntl.h>
#include <string.h>
@@ -507,7 +508,7 @@ verify(const char *pubkeyfile, const char *msgfile, const char *sigfile,
#ifndef VERIFYONLY
#define HASHBUFSIZE 224
struct checksum {
- char file[1024];
+ char file[PATH_MAX];
char hash[HASHBUFSIZE];
char algo[32];
};
@@ -647,7 +648,7 @@ main(int argc, char **argv)
{
const char *pubkeyfile = NULL, *seckeyfile = NULL, *msgfile = NULL,
*sigfile = NULL;
- char sigfilebuf[1024];
+ char sigfilebuf[PATH_MAX];
const char *comment = "signify";
int ch, rounds;
int embedded = 0;