Fix the check routine for elf sections

This commit is contained in:
Takayuki Okamoto
2017-09-25 17:57:27 +09:00
committed by Hannes Weisbach
parent e664ffba18
commit 8813e890c5

View File

@ -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;
}