The bytes_transfer_piod_read_auxv test uses 4096 for the size param

to bytes_transfer() which asserted that the size is < the size of 512 AuxInfo
structs.   On a 32 bit system, an AuxInfo is 8 bytes, and 512 AuxInfo
structs is thus 4096 bytes, and 4096 is not < 4096, so the assertion
failed.   It would probably work as a <= assert, but I am not confident
enough with this test case to make that call, so instead increase the
array size to be 513 instead, 4096 is < 513*8 so happiness should return
and all should be right with the world.   At least for this one test.
(There was no problem on 64 bit systems as AuxInfo is bigger there.)
This commit is contained in:
kre 2018-05-30 05:09:11 +00:00
parent be7413dae4
commit 64d884c8fc

View File

@ -1,4 +1,4 @@
/* $NetBSD: t_ptrace_wait.c,v 1.59 2018/05/29 10:40:54 kamil Exp $ */
/* $NetBSD: t_ptrace_wait.c,v 1.60 2018/05/30 05:09:11 kre Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: t_ptrace_wait.c,v 1.59 2018/05/29 10:40:54 kamil Exp $");
__RCSID("$NetBSD: t_ptrace_wait.c,v 1.60 2018/05/30 05:09:11 kre Exp $");
#include <sys/param.h>
#include <sys/types.h>
@ -2021,8 +2021,8 @@ bytes_transfer(int operation, size_t size, enum bytes_transfer_type type)
#if defined(TWAIT_HAVE_STATUS)
int status;
#endif
/* 512 is more than enough, for the purposes of ATF it's good enough */
AuxInfo ai[512], *aip;
/* 513 is just enough, for the purposes of ATF it's good enough */
AuxInfo ai[513], *aip;
ATF_REQUIRE(size < sizeof(ai));