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:
Shuo A Liu
2018-12-25 10:33:36 +08:00
committed by wenlingz
parent 3e0b06cfd6
commit b3ad44d4c1
14 changed files with 27 additions and 25 deletions

View File

@@ -126,7 +126,7 @@ int
acrn_parse_guest_part_info(char *arg)
{
int error;
size_t len = strlen(arg);
size_t len = strnlen(arg, STR_LEN);
if (len < STR_LEN) {
strncpy(guest_part_info_path, arg, len + 1);
@@ -195,7 +195,7 @@ int
acrn_parse_vsbl(char *arg)
{
int error;
size_t len = strlen(arg);
size_t len = strnlen(arg, STR_LEN);
if (len < STR_LEN) {
strncpy(vsbl_path, arg, len + 1);