diff options
author | joerg <joerg@pkgsrc.org> | 2008-01-30 21:52:09 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2008-01-30 21:52:09 +0000 |
commit | 8fee404627abcfb0c7f30ddcc6316cf364b81723 (patch) | |
tree | 7be8e82d48d27b0fe64fff523e49c39c987b917f | |
parent | b5188984d224553c62f6798183fc5d9ce3931f37 (diff) | |
download | pkgsrc-8fee404627abcfb0c7f30ddcc6316cf364b81723.tar.gz |
Fix a limit check.
-rw-r--r-- | pkgtools/pbulk/files/pbulk/lib/read_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgtools/pbulk/files/pbulk/lib/read_file.c b/pkgtools/pbulk/files/pbulk/lib/read_file.c index b25412cfff4..de0e6a1c98c 100644 --- a/pkgtools/pbulk/files/pbulk/lib/read_file.c +++ b/pkgtools/pbulk/files/pbulk/lib/read_file.c @@ -1,4 +1,4 @@ -/* $NetBSD: read_file.c,v 1.3 2007/11/13 19:30:26 rillig Exp $ */ +/* $NetBSD: read_file.c,v 1.4 2008/01/30 21:52:09 joerg Exp $ */ /*- * Copyright (c) 2007 Joerg Sonnenberger <joerg@NetBSD.org>. @@ -55,7 +55,7 @@ read_from_file(int fd) if ((sb.st_mode & S_IFMT) != S_IFREG) errx(1, "Input is not regular file"); - if (sb.st_size > SSIZE_MAX) + if (sb.st_size > SSIZE_MAX - 1) errx(1, "Input too large"); input_len = (size_t)sb.st_size; |