summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/lpd/recvjob.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-25 19:38:24 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-10-25 19:38:24 +0000
commit54d9c030a9eb88aec5d7bca3eddad4a71b52ed1f (patch)
tree26398a3548b72884d9e7f88f1e303d772bd8ff91 /usr.sbin/lpr/lpd/recvjob.c
parentcf129a78e19c51cae5e0dcb02628e09c4ef90191 (diff)
proactive bounds checking; help from millert
Diffstat (limited to 'usr.sbin/lpr/lpd/recvjob.c')
-rw-r--r--usr.sbin/lpr/lpd/recvjob.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/lpr/lpd/recvjob.c b/usr.sbin/lpr/lpd/recvjob.c
index 9d5b252da60..ea2128cd31e 100644
--- a/usr.sbin/lpr/lpd/recvjob.c
+++ b/usr.sbin/lpr/lpd/recvjob.c
@@ -150,7 +150,9 @@ readjob()
printer);
return(nfiles);
}
- } while (*cp++ != '\n');
+ } while (*cp++ != '\n' && (cp - line + 1) < sizeof line);
+ if (cp - line + 1 < sizeof line)
+ frecverr("readjob overflow");
*--cp = '\0';
cp = line;
switch (*cp++) {