mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-21 05:02:24 +00:00
HV: correct bootargs module size
The bootargs module represents a string buffer and there is a NULL char at the end so its size should not be calculated by strnlen_s(), otherwise the NULL char will be ignored in gpa copy and result in kernel boot fail; Tracked-On: #6162 Signed-off-by: Victor Sun <victor.sun@intel.com>
This commit is contained in:
parent
695e09a194
commit
c70b450ed3
@ -271,7 +271,7 @@ static void init_vm_bootargs_info(struct acrn_vm *vm, const struct acrn_boot_inf
|
||||
|
||||
}
|
||||
|
||||
vm->sw.bootargs_info.size = strnlen_s((const char *)vm->sw.bootargs_info.src_addr, MAX_BOOTARGS_SIZE);
|
||||
vm->sw.bootargs_info.size = strnlen_s((const char *)vm->sw.bootargs_info.src_addr, (MAX_BOOTARGS_SIZE - 1U)) + 1U;
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user