From 8813e890c5a6b1fde09686737ec1ad11cb83e2a4 Mon Sep 17 00:00:00 2001 From: Takayuki Okamoto Date: Mon, 25 Sep 2017 17:57:27 +0900 Subject: [PATCH] Fix the check routine for elf sections --- kernel/host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/host.c b/kernel/host.c index 0c756d7c..8ebcc967 100644 --- a/kernel/host.c +++ b/kernel/host.c @@ -432,8 +432,8 @@ static int process_msg_prepare_process(unsigned long rphys) } n = p->num_sections; - if (n > 16) { - kprintf("%s: ERROR: more ELF sections than 16??\n", + if (n > 16 || 0 >= n) { + kprintf("%s: ERROR: ELF sections other than 1 to 16 ??\n", __FUNCTION__); return -ENOMEM; }