summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-09-02 00:14:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-09-02 00:14:24 +0000
commitc8de02ffa6b583f47c1038564ed633db8eb01744 (patch)
tree8fc3649dd77eff9f2284fcf04d8fdd8873787113 /usr.sbin/lpr
parent90a0f4c637ddce658bb62aedc44ae30b1ba0a18f (diff)
be more careful in checking disk space; ok millert
Diffstat (limited to 'usr.sbin/lpr')
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index 68c1db8c71d..d1a9b3b24a4 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: recvjob.c,v 1.23 2003/06/02 23:36:53 millert Exp $ */
+/* $OpenBSD: recvjob.c,v 1.24 2008/09/02 00:14:23 deraadt Exp $ */
/* $NetBSD: recvjob.c,v 1.14 2001/12/04 22:52:44 christos Exp $ */
/*
@@ -41,7 +41,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)recvjob.c 8.2 (Berkeley) 4/27/95";
#else
-static const char rcsid[] = "$OpenBSD: recvjob.c,v 1.23 2003/06/02 23:36:53 millert Exp $";
+static const char rcsid[] = "$OpenBSD: recvjob.c,v 1.24 2008/09/02 00:14:23 deraadt Exp $";
#endif
#endif /* not lint */
@@ -297,9 +297,11 @@ noresponse(void)
static int
chksize(int size)
{
- int spacefree;
+ int64_t spacefree;
struct statfs sfb;
+ if (size <= 0)
+ return (0);
if (statfs(".", &sfb) < 0) {
syslog(LOG_ERR, "%s: %m", "statfs(\".\")");
return (1);