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 ff2ed240a0
commit 0bb20c3812
14 changed files with 27 additions and 25 deletions

View File

@@ -205,7 +205,7 @@ static int rpmb_check_frame(const char *cmd_str, int *err,
return -1;
}
len = strlen(cmd_str) + 1;
len = strnlen(cmd_str, sizeof(WRITE_DATA_STR)) + 1;
if (len > sizeof(WRITE_DATA_STR))
len = sizeof(WRITE_DATA_STR);