summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2001-12-06 04:21:27 +0000
committerderaadt <deraadt@openbsd.org>2001-12-06 04:21:27 +0000
commit290f140d4fb03df5d1d282b516c06fd1b3e6ca9d (patch)
treeb00f892bd8bc850354be88848fbe3b4908b49121
parentremove kame IPSEC code within #ifdef. (diff)
downloadwireguard-openbsd-290f140d4fb03df5d1d282b516c06fd1b3e6ca9d.tar.xz
wireguard-openbsd-290f140d4fb03df5d1d282b516c06fd1b3e6ca9d.zip
alloca cannot check if the allocation is valid. mention the consequences; millert ok
-rw-r--r--lib/libc/stdlib/alloca.314
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/libc/stdlib/alloca.3 b/lib/libc/stdlib/alloca.3
index e9e0b67ee32..431443a6e65 100644
--- a/lib/libc/stdlib/alloca.3
+++ b/lib/libc/stdlib/alloca.3
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: alloca.3,v 1.8 2000/04/20 13:50:01 aaron Exp $
+.\" $OpenBSD: alloca.3,v 1.9 2001/12/06 04:21:27 deraadt Exp $
.\"
.Dd May 2, 1991
.Dt ALLOCA 3
@@ -70,3 +70,15 @@ function is machine dependent; its use is discouraged.
.\" The function appeared in 32v, pwb and pwb.2 and in 3bsd 4bsd
.\" The first man page (or link to a man page that I can find at the
.\" moment is 4.3...
+.Pp
+The
+.Fn alloca
+function is slightly unsafe because it cannot ensure that the pointer
+returned points to a valid and usable block of memory.
+The allocation made may exceed the bounds of the stack, or even go
+further into other objects in memory, and
+.Fn alloca
+cannot determine such an error.
+Avoid
+.Fn alloca
+with large unbounded allocations.