mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-02 01:16:50 +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:
@@ -93,7 +93,7 @@ vm_create(const char *name, uint64_t req_buf)
|
||||
uuid_t vm_uuid;
|
||||
|
||||
memset(&create_vm, 0, sizeof(struct acrn_create_vm));
|
||||
ctx = calloc(1, sizeof(struct vmctx) + strlen(name) + 1);
|
||||
ctx = calloc(1, sizeof(struct vmctx) + strnlen(name, PATH_MAX) + 1);
|
||||
assert(ctx != NULL);
|
||||
assert(devfd == -1);
|
||||
|
||||
|
Reference in New Issue
Block a user