diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1997-01-17 15:52:00 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1997-01-17 15:52:00 +0000 |
commit | 6d08091a85cb55f482d550e4fb154a7868d31eeb (patch) | |
tree | ae0fafb4189cfcc8254c1e852b5d9f1c47eaf08f /usr.sbin/lpr/lpc | |
parent | 3c88ae792b55dd2c5889f62eee2734d7d47328f2 (diff) |
possible oflow
Diffstat (limited to 'usr.sbin/lpr/lpc')
-rw-r--r-- | usr.sbin/lpr/lpc/cmds.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c index a03238d72ca..bb2e5c83cbb 100644 --- a/usr.sbin/lpr/lpc/cmds.c +++ b/usr.sbin/lpr/lpc/cmds.c @@ -341,7 +341,8 @@ cleanpr() n++; } if (n == 0) { - strcpy(lp, cp); + strncpy(lp, cp, sizeof(line) - strlen(line) - 1); + line[sizeof(line) - 1] = '\0'; unlinkf(line); } } else { @@ -350,7 +351,8 @@ cleanpr() * been skipped above) or a tf file (which can always * be removed). */ - strcpy(lp, cp); + strncpy(lp, cp, sizeof(line) - strlen(line) - 1); + line[sizeof(line) - 1] = '\0'; unlinkf(line); } } while (++i < nitems); |