aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-03-10 14:17:52 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-03-10 14:17:52 +0000
commit586630ee92a46a463566d9f713fa7d90f8283948 (patch)
treecb1a74c6a1622189c441c76f239fb084c402d83f
parentfb4a771ef09a320db54647c9ec85bd523100cf3c (diff)
downloadmandoc-586630ee92a46a463566d9f713fa7d90f8283948.tar.gz
mandoc-586630ee92a46a463566d9f713fa7d90f8283948.tar.zst
mandoc-586630ee92a46a463566d9f713fa7d90f8283948.zip
The st_size member of struct stat is off_t, which is signed,
all required by POSIX. So don't compare it against against an unsigned constant.
-rw-r--r--read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/read.c b/read.c
index 0b4caa05..763bf4e9 100644
--- a/read.c
+++ b/read.c
@@ -1,4 +1,4 @@
-/* $Id: read.c,v 1.129 2015/03/02 14:50:17 schwarze Exp $ */
+/* $Id: read.c,v 1.130 2015/03/10 14:17:52 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -636,7 +636,7 @@ read_whole_file(struct mparse *curp, const char *file, int fd,
*/
if (S_ISREG(st.st_mode)) {
- if (st.st_size >= (1U << 31)) {
+ if ((size_t)st.st_size >= (1U << 31)) {
mandoc_msg(MANDOCERR_TOOLARGE, curp, 0, 0, NULL);
return(0);
}