summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2014-10-10 08:57:55 +0000
committerngie <ngie@FreeBSD.org>2014-10-10 08:57:55 +0000
commitfd80e03aa02bfa9b05a962c7f6dcb30c38a1cee0 (patch)
tree98402731b425ac6bdbaff3b97b86fbdcaf9073ea /contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
parent5f8801236b0c57109e8ae8ba658b71fe44d74dea (diff)
downloadFreeBSD-src-fd80e03aa02bfa9b05a962c7f6dcb30c38a1cee0.zip
FreeBSD-src-fd80e03aa02bfa9b05a962c7f6dcb30c38a1cee0.tar.gz
Expect SIGSEGV in lib/libc/stdlib/t_getenv:setenv_basic
See bin/189805 for more details In collaboration with: pho Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c')
-rw-r--r--contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
index 35d6874..3b0b885 100644
--- a/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
+++ b/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c
@@ -40,6 +40,9 @@ __RCSID("$NetBSD: t_getenv.c,v 1.2 2011/07/15 13:54:31 jruoho Exp $");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#if defined(__FreeBSD__)
+#include <signal.h>
+#endif
extern char **environ;
@@ -152,6 +155,15 @@ ATF_TC_BODY(setenv_basic, tc)
ATF_CHECK_ERRNO(EINVAL, setenv(NULL, "val", 1) == -1);
ATF_CHECK_ERRNO(EINVAL, setenv("", "val", 1) == -1);
ATF_CHECK_ERRNO(EINVAL, setenv("v=r", "val", 1) == -1);
+#if defined(__FreeBSD__)
+ /*
+ Both FreeBSD and OS/X does not validate the second
+ argument to setenv(3)
+ */
+ atf_tc_expect_signal(SIGSEGV, "FreeBSD does not validate the second "
+ "argument to setenv(3); see bin/189805");
+#endif
+
ATF_CHECK_ERRNO(EINVAL, setenv("var", NULL, 1) == -1);
ATF_CHECK(setenv("var", "=val", 1) == 0);
OpenPOWER on IntegriCloud