artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
047169a
)
possible oflow
author
millert
<millert@openbsd.org>
Fri, 17 Jan 1997 15:51:59 +0000
(15:51 +0000)
committer
millert
<millert@openbsd.org>
Fri, 17 Jan 1997 15:51:59 +0000
(15:51 +0000)
usr.sbin/lpr/lpc/cmds.c
patch
|
blob
|
history
diff --git
a/usr.sbin/lpr/lpc/cmds.c
b/usr.sbin/lpr/lpc/cmds.c
index
a03238d
..
bb2e5c8
100644
(file)
--- 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);