summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1997-09-16 23:03:11 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1997-09-16 23:03:11 +0000
commitae78b02b5658b08941e7458e9d021e1a02c2561d (patch)
tree0aeff6ddfe9ccd073f720d52aaff5242e3485821 /usr.bin
parente6687407df724f864722874c9184063ea5ad307c (diff)
Possible buf oflow, from Theo.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/sup/src/expand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/sup/src/expand.c b/usr.bin/sup/src/expand.c
index dd5f2aa82d5..d27a11c034a 100644
--- a/usr.bin/sup/src/expand.c
+++ b/usr.bin/sup/src/expand.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expand.c,v 1.5 1997/09/16 11:13:59 deraadt Exp $ */
+/* $OpenBSD: expand.c,v 1.6 1997/09/16 23:03:10 millert Exp $ */
/*
* Copyright (c) 1991 Carnegie Mellon University
@@ -242,8 +242,8 @@ pend:
doit:
savec = *pm;
*pm = 0;
- strcpy(lm, pl);
- strcat(restbuf, pe + 1);
+ snprintf(lm, sizeof(restbuf) - (lm - restbuf),
+ "%s%s", pl, pe + 1);
*pm = savec;
if (s == 0) {
spathp = pathp;