pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pbulk/files/pbulk/lib Fix a limit check.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/94df73c2cf88
branches:  trunk
changeset: 538163:94df73c2cf88
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Wed Jan 30 21:52:09 2008 +0000

description:
Fix a limit check.

diffstat:

 pkgtools/pbulk/files/pbulk/lib/read_file.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 1a9fcde9eab2 -r 94df73c2cf88 pkgtools/pbulk/files/pbulk/lib/read_file.c
--- a/pkgtools/pbulk/files/pbulk/lib/read_file.c        Wed Jan 30 19:26:00 2008 +0000
+++ b/pkgtools/pbulk/files/pbulk/lib/read_file.c        Wed Jan 30 21:52:09 2008 +0000
@@ -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@localhost>.
@@ -55,7 +55,7 @@
        
        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;



Home | Main Index | Thread Index | Old Index