summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-03-11 13:04:11 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-03-11 13:04:11 +0000
commit0a0782ec1052b004211350696e5c134d929892f1 (patch)
tree040e56b25586e5ae85b719b0b25b67069c4295f9 /usr.bin/mandoc
parent83320c302a3d286e75b08139bfdb7a7355eed10a (diff)
Fix previous: size_t is often narrower than off_t.
Cluestick applied by joerg at NetBSD.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c
index 66b64bba92d..9e33c1ed943 100644
--- a/usr.bin/mandoc/read.c
+++ b/usr.bin/mandoc/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.105 2015/03/10 14:17:22 schwarze Exp $ */
+/* $OpenBSD: read.c,v 1.106 2015/03/11 13:04:10 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -630,7 +630,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd,
*/
if (S_ISREG(st.st_mode)) {
- if ((size_t)st.st_size >= (1U << 31)) {
+ if (st.st_size > 0x7fffffff) {
mandoc_msg(MANDOCERR_TOOLARGE, curp, 0, 0, NULL);
return(0);
}