Module Name: src Committed By: christos Date: Sun May 27 00:36:56 UTC 2018
Modified Files: src/tests/lib/libc/sys: t_ptrace_wait.c Log Message: alloca, bad; stack protector, good. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/tests/lib/libc/sys/t_ptrace_wait.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/lib/libc/sys/t_ptrace_wait.c diff -u src/tests/lib/libc/sys/t_ptrace_wait.c:1.54 src/tests/lib/libc/sys/t_ptrace_wait.c:1.55 --- src/tests/lib/libc/sys/t_ptrace_wait.c:1.54 Sat May 26 11:32:31 2018 +++ src/tests/lib/libc/sys/t_ptrace_wait.c Sat May 26 20:36:56 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: t_ptrace_wait.c,v 1.54 2018/05/26 15:32:31 kamil Exp $ */ +/* $NetBSD: t_ptrace_wait.c,v 1.55 2018/05/27 00:36:56 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: t_ptrace_wait.c,v 1.54 2018/05/26 15:32:31 kamil Exp $"); +__RCSID("$NetBSD: t_ptrace_wait.c,v 1.55 2018/05/27 00:36:56 christos Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -1711,12 +1711,11 @@ bytes_transfer_dummy(int a, int b, int c } static void -bytes_transfer(int operation, int size, enum bytes_transfer_type type) +bytes_transfer(int operation, size_t size, enum bytes_transfer_type type) { const int exitval = 5; const int sigval = SIGSTOP; pid_t child, wpid; - bool skip = false; int lookup_me = 0; @@ -1735,7 +1734,9 @@ bytes_transfer(int operation, int size, #if defined(TWAIT_HAVE_STATUS) int status; #endif - AuxInfo *ai = NULL, *aip; + AuxInfo ai[64], *aip; + + ATF_REQUIRE(size < sizeof(ai)); /* Prepare variables for .TEXT transfers */ switch (type) { @@ -1801,7 +1802,6 @@ bytes_transfer(int operation, int size, } break; case BYTES_TRANSFER_AUXV: - ai = alloca(size); io.piod_op = operation; io.piod_offs = 0; io.piod_addr = ai;