Remove bogus checks against NCARGS.

NCARGS isn't a limit on the number of arguments to pass to a function,
but the number of bytes that can be consumed by arguments to exec.  As
such, it is not suitable for a limit on the count of arguments passed
to makecontext().

Sponsored by:	DARPA / AFRL
This commit is contained in:
John Baldwin 2018-01-31 17:57:59 +00:00
parent 7193311b15
commit 80996ef878
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328631
3 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...)
ucp->uc_mcontext.mc_len = 0;
}
/* XXX - Do we want to sanity check argc? */
else if ((argc < 0) || (argc > NCARGS)) {
else if (argc < 0) {
ucp->uc_mcontext.mc_len = 0;
}
/* Make sure the context is valid. */

View File

@ -66,7 +66,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...)
int i, regargs, stackargs;
/* Sanity checks */
if ((ucp == NULL) || (argc < 0) || (argc > NCARGS)
if ((ucp == NULL) || (argc < 0)
|| (ucp->uc_stack.ss_sp == NULL)
|| (ucp->uc_stack.ss_size < MINSIGSTKSZ)) {
/* invalidate context */

View File

@ -66,7 +66,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), int argc, ...)
int i, regargs, stackargs;
/* Sanity checks */
if ((ucp == NULL) || (argc < 0) || (argc > NCARGS)
if ((ucp == NULL) || (argc < 0)
|| (ucp->uc_stack.ss_sp == NULL)
|| (ucp->uc_stack.ss_size < MINSIGSTKSZ)) {
/* invalidate context */