diff options
| author | deraadt <> | 2001-12-06 04:21:27 +0000 |
|---|---|---|
| committer | deraadt <> | 2001-12-06 04:21:27 +0000 |
| commit | 00a5b66e44967336be0fc76ef57bae611e741cde (patch) | |
| tree | 2f1ecad4f909b80e2d3d4c36a2dc50e8c489e322 | |
| parent | e0fe449a9f991163722343b2b40f45c42b13972b (diff) | |
| download | openbsd-00a5b66e44967336be0fc76ef57bae611e741cde.tar.gz openbsd-00a5b66e44967336be0fc76ef57bae611e741cde.tar.bz2 openbsd-00a5b66e44967336be0fc76ef57bae611e741cde.zip | |
alloca cannot check if the allocation is valid. mention the consequences; millert ok
| -rw-r--r-- | src/lib/libc/stdlib/alloca.3 | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/alloca.3 b/src/lib/libc/stdlib/alloca.3 index e9e0b67ee3..431443a6e6 100644 --- a/src/lib/libc/stdlib/alloca.3 +++ b/src/lib/libc/stdlib/alloca.3 | |||
| @@ -29,7 +29,7 @@ | |||
| 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
| 31 | .\" | 31 | .\" |
| 32 | .\" $OpenBSD: alloca.3,v 1.8 2000/04/20 13:50:01 aaron Exp $ | 32 | .\" $OpenBSD: alloca.3,v 1.9 2001/12/06 04:21:27 deraadt Exp $ |
| 33 | .\" | 33 | .\" |
| 34 | .Dd May 2, 1991 | 34 | .Dd May 2, 1991 |
| 35 | .Dt ALLOCA 3 | 35 | .Dt ALLOCA 3 |
| @@ -70,3 +70,15 @@ function is machine dependent; its use is discouraged. | |||
| 70 | .\" The function appeared in 32v, pwb and pwb.2 and in 3bsd 4bsd | 70 | .\" The function appeared in 32v, pwb and pwb.2 and in 3bsd 4bsd |
| 71 | .\" The first man page (or link to a man page that I can find at the | 71 | .\" The first man page (or link to a man page that I can find at the |
| 72 | .\" moment is 4.3... | 72 | .\" moment is 4.3... |
| 73 | .Pp | ||
| 74 | The | ||
| 75 | .Fn alloca | ||
| 76 | function is slightly unsafe because it cannot ensure that the pointer | ||
| 77 | returned points to a valid and usable block of memory. | ||
| 78 | The allocation made may exceed the bounds of the stack, or even go | ||
| 79 | further into other objects in memory, and | ||
| 80 | .Fn alloca | ||
| 81 | cannot determine such an error. | ||
| 82 | Avoid | ||
| 83 | .Fn alloca | ||
| 84 | with large unbounded allocations. | ||
