mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-17 06:49:25 +00:00
dm: use strnlen to replace strlen
Tracked-On: #2133 Signed-off-by: Shuo A Liu <shuo.a.liu@intel.com> Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
This commit is contained in:
@@ -129,7 +129,7 @@ acrn_get_bzimage_setup_size(struct vmctx *ctx)
|
||||
int
|
||||
acrn_parse_kernel(char *arg)
|
||||
{
|
||||
size_t len = strlen(arg);
|
||||
size_t len = strnlen(arg, STR_LEN);
|
||||
|
||||
if (len < STR_LEN) {
|
||||
strncpy(kernel_path, arg, len + 1);
|
||||
@@ -150,7 +150,7 @@ acrn_parse_kernel(char *arg)
|
||||
int
|
||||
acrn_parse_ramdisk(char *arg)
|
||||
{
|
||||
size_t len = strlen(arg);
|
||||
size_t len = strnlen(arg, STR_LEN);
|
||||
|
||||
if (len < STR_LEN) {
|
||||
strncpy(ramdisk_path, arg, len + 1);
|
||||
|
Reference in New Issue
Block a user