aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/unix/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/unix/main.c')
-rwxr-xr-xsrc/vlib/unix/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index 82de8ec7632..8c9bc1b2ce2 100755
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -641,7 +641,7 @@ thread0 (uword arg)
u8 *
vlib_thread_stack_init (uword thread_index)
{
- vec_validate (vlib_thread_stacks, thread_index);
+ ASSERT (thread_index < vec_len (vlib_thread_stacks));
vlib_thread_stacks[thread_index] = clib_mem_alloc_aligned
(VLIB_THREAD_STACK_SIZE, clib_mem_get_page_size ());
@@ -696,6 +696,7 @@ vlib_unix_main (int argc, char *argv[])
/* always load symbols, for signal handler and mheap memory get/put backtrace */
clib_elf_main_init (vm->name);
+ vec_validate (vlib_thread_stacks, 0);
vlib_thread_stack_init (0);
__os_thread_index = 0;