summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoraaron <>2001-06-14 20:38:38 +0000
committeraaron <>2001-06-14 20:38:38 +0000
commitdc434cd5b372d1a7d9b39f538bdcaacb59d07ede (patch)
tree51f20365f6ecc2e5f7c4b66eff3751b1918db3c5 /src
parent8ba427fe118db4227e173159131b4038d341eee8 (diff)
downloadopenbsd-dc434cd5b372d1a7d9b39f538bdcaacb59d07ede.tar.gz
openbsd-dc434cd5b372d1a7d9b39f538bdcaacb59d07ede.tar.bz2
openbsd-dc434cd5b372d1a7d9b39f538bdcaacb59d07ede.zip
Fix a buf oflow in EXAMPLES code; millert@ ok
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/string/strsep.39
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libc/string/strsep.3 b/src/lib/libc/string/strsep.3
index b15915ab37..33cb2803c5 100644
--- a/src/lib/libc/string/strsep.3
+++ b/src/lib/libc/string/strsep.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: strsep.3,v 1.8 2000/04/21 15:24:20 aaron Exp $ 1.\" $OpenBSD: strsep.3,v 1.9 2001/06/14 20:38:38 aaron Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991, 1993 3.\" Copyright (c) 1990, 1991, 1993
4.\" The Regents of the University of California. All rights reserved. 4.\" The Regents of the University of California. All rights reserved.
@@ -90,9 +90,12 @@ argument vector:
90.Bd -literal -offset indent 90.Bd -literal -offset indent
91char **ap, *argv[10], *inputstring; 91char **ap, *argv[10], *inputstring;
92 92
93for (ap = argv; (*ap = strsep(&inputstring, " \et")) != NULL;) 93for (ap = argv; ap < &argv[9] &&
94 (*ap = strsep(&inputstring, " \et")) != NULL;) {
94 if (**ap != '\e0') 95 if (**ap != '\e0')
95 ++ap; 96 ap++;
97}
98*ap = NULL;
96.Ed 99.Ed
97.Sh HISTORY 100.Sh HISTORY
98The 101The