Date: Sat, 1 Nov 2014 21:00:41 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273947 - head/contrib/netbsd-tests/lib/libc/stdio Message-ID: <201411012100.sA1L0fU0043137@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Sat Nov 1 21:00:40 2014 New Revision: 273947 URL: https://svnweb.freebsd.org/changeset/base/273947 Log: Expect :snprintf_posarg_error to blow up with a SIGSEGV on !NetBSD OSes Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Modified: head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Sat Nov 1 20:50:39 2014 (r273946) +++ head/contrib/netbsd-tests/lib/libc/stdio/t_printf.c Sat Nov 1 21:00:40 2014 (r273947) @@ -36,6 +36,10 @@ #include <time.h> #include <stdlib.h> +#ifndef __NetBSD__ +#include <signal.h> +#endif + ATF_TC(snprintf_c99); ATF_TC_HEAD(snprintf_c99, tc) { @@ -116,6 +120,12 @@ ATF_TC_BODY(snprintf_posarg_error, tc) { char s[16], fmt[32]; +#ifndef __NetBSD__ + atf_tc_expect_signal(SIGSEGV, + "some non-NetBSD platforms including FreeBSD don't validate " + "negative size; testcase blows up with SIGSEGV"); +#endif + snprintf(fmt, sizeof(fmt), "%%%zu$d", SIZE_MAX / sizeof(size_t)); ATF_CHECK(snprintf(s, sizeof(s), fmt, -23) == -1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411012100.sA1L0fU0043137>