From df50f5d5668c1dd3920be8a8c09c8bbd00f223cd Mon Sep 17 00:00:00 2001 From: mickey <> Date: Wed, 12 Feb 2003 06:49:04 +0000 Subject: simple alloca test. done twice per deraadt@ suggest --- src/regress/lib/libc/Makefile | 3 ++- src/regress/lib/libc/alloca/Makefile | 5 +++++ src/regress/lib/libc/alloca/alloca.c | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 src/regress/lib/libc/alloca/Makefile create mode 100644 src/regress/lib/libc/alloca/alloca.c diff --git a/src/regress/lib/libc/Makefile b/src/regress/lib/libc/Makefile index d383b58371..e8c5809eb6 100644 --- a/src/regress/lib/libc/Makefile +++ b/src/regress/lib/libc/Makefile @@ -1,5 +1,6 @@ -# $OpenBSD: Makefile,v 1.9 2002/08/30 07:58:08 dhartmei Exp $ +# $OpenBSD: Makefile,v 1.10 2003/02/12 06:49:04 mickey Exp $ +SUBDIR+= alloca SUBDIR+= _setjmp db getaddrinfo regex setjmp sigsetjmp malloc sigreturn popen SUBDIR+= longjmp atexit .if (${MACHINE_ARCH} != "vax") diff --git a/src/regress/lib/libc/alloca/Makefile b/src/regress/lib/libc/alloca/Makefile new file mode 100644 index 0000000000..f31417cda7 --- /dev/null +++ b/src/regress/lib/libc/alloca/Makefile @@ -0,0 +1,5 @@ +# $OpenBSD: Makefile,v 1.1 2003/02/12 06:49:04 mickey Exp $ + +PROG= alloca + +.include diff --git a/src/regress/lib/libc/alloca/alloca.c b/src/regress/lib/libc/alloca/alloca.c new file mode 100644 index 0000000000..4f1f18396a --- /dev/null +++ b/src/regress/lib/libc/alloca/alloca.c @@ -0,0 +1,19 @@ +/* $OpeBSD$ */ + +/* Copyright (c) 2003 Michael Shalayeff. Public Domain. */ + +#include + +int +main() +{ + char *q, *p; + + p = alloca(41); + strcpy(p, "hellow world"); + + q = alloca(53); + strcpy(q, "hellow world"); + + exit(strcmp(p, q)); +} -- cgit v1.2.3-55-g6feb