diff options
author | aaron <> | 2001-06-14 20:38:38 +0000 |
---|---|---|
committer | aaron <> | 2001-06-14 20:38:38 +0000 |
commit | dc434cd5b372d1a7d9b39f538bdcaacb59d07ede (patch) | |
tree | 51f20365f6ecc2e5f7c4b66eff3751b1918db3c5 /src | |
parent | 8ba427fe118db4227e173159131b4038d341eee8 (diff) | |
download | openbsd-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.3 | 9 |
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 |
91 | char **ap, *argv[10], *inputstring; | 91 | char **ap, *argv[10], *inputstring; |
92 | 92 | ||
93 | for (ap = argv; (*ap = strsep(&inputstring, " \et")) != NULL;) | 93 | for (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 |
98 | The | 101 | The |