=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/file.c,v retrieving revision 1.227 retrieving revision 1.228 diff -u -r1.227 -r1.228 --- src/usr.bin/cvs/file.c 2008/03/08 20:26:34 1.227 +++ src/usr.bin/cvs/file.c 2008/03/09 01:02:38 1.228 @@ -1,4 +1,4 @@ -/* $OpenBSD: file.c,v 1.227 2008/03/08 20:26:34 joris Exp $ */ +/* $OpenBSD: file.c,v 1.228 2008/03/09 01:02:38 tobias Exp $ */ /* * Copyright (c) 2006 Joris Vink * Copyright (c) 2004 Jean-Francois Brousseau @@ -430,6 +430,9 @@ fatal("cvs_file_walkdir: %s %s", cf->file_path, strerror(errno)); + if (st.st_size > SIZE_MAX) + fatal("cvs_file_walkdir: %s: file size too big", cf->file_name); + bufsize = st.st_size; if (bufsize < st.st_blksize) bufsize = st.st_blksize; @@ -967,7 +970,7 @@ if (S_ISREG(stb1.st_mode)) { void *p1, *p2; - if (stb1.st_size > (off_t)SIZE_MAX) { + if (stb1.st_size > SIZE_MAX) { ret = 1; goto out; } @@ -1024,7 +1027,7 @@ char *p; int saved_errno; - if (st.st_size > (off_t)SIZE_MAX) { + if (st.st_size > SIZE_MAX) { ret = -1; goto out; }