From 5986aee429b436b742fe4deae57feaf60fbe3bf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Tue, 2 Jul 2019 10:52:56 +0200 Subject: [PATCH] ECL_STACK_FRAME_VARARGS_BEGIN: fix off-by-one error We allocate arguments on a heap when number of them exceeds ECL_C_ARGUMENTS_LIMIT. Was: if (narg < ECL_C_ARGUMENTS_LIMIT) ... else .. should be if (narg <= ECL_C_ARGUMENTS_LIMIT) ... else .. It is a partial fix for #513 (solves a segfault). --- src/h/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/h/internal.h b/src/h/internal.h index 677ff5ffd..3ca8c2efb 100755 --- a/src/h/internal.h +++ b/src/h/internal.h @@ -182,7 +182,7 @@ extern cl_object si_constant_form_value _ECL_ARGS((cl_narg narg, cl_object form, frame->frame.t = t_frame; \ frame->frame.env = env; \ frame->frame.size = narg; \ - if (narg < ECL_C_ARGUMENTS_LIMIT) { \ + if (narg <= ECL_C_ARGUMENTS_LIMIT) { \ cl_object *p = frame->frame.base = env->values; \ va_list args; \ va_start(args, lastarg); \