multiboot: zero mod list array
Zero the list of modules array before using it, or else we might pass uninitialized data in unused fields of the struct that will make Xen choke. Also add a check to make sure malloc succeeds. Sponsored by: Citrix Systems R&D
This commit is contained in:
parent
f03b8244b4
commit
e1c124dc44
@ -274,7 +274,14 @@ multiboot_exec(struct preloaded_file *fp)
|
||||
error = EFTYPE;
|
||||
goto error;
|
||||
}
|
||||
|
||||
mb_mod = malloc(sizeof(struct multiboot_mod_list) * NUM_MODULES);
|
||||
if (mb_mod == NULL) {
|
||||
error = ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
|
||||
bzero(mb_mod, sizeof(struct multiboot_mod_list) * NUM_MODULES);
|
||||
|
||||
/*
|
||||
* Calculate how much memory is needed for the metatdata. We did
|
||||
|
Loading…
x
Reference in New Issue
Block a user