summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-03-11 13:05:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-03-11 13:05:20 +0000
commita6b05481ff237dc3c50886dab2642a2d007a78ff (patch)
treecbe67e592bfacba0d946f08fc005dc99def9779f /read.c
parentdbb8d57932ef4bb217cf0861ef4f37aeee2be04c (diff)
downloadmandoc-a6b05481ff237dc3c50886dab2642a2d007a78ff.tar.gz
Fix previous: size_t is often narrower than off_t.
Cluestick applied by joerg at NetBSD.
Diffstat (limited to 'read.c')
-rw-r--r--read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/read.c b/read.c
index efd08d1f..abad8e0c 100644
--- a/read.c
+++ b/read.c
@@ -636,7 +636,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);
}