mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 10:04:42 +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:
@@ -37,9 +37,9 @@ char *const token[] = {
|
||||
int acrn_parse_vtpm2(char *arg)
|
||||
{
|
||||
char *value;
|
||||
size_t len = strlen(arg);
|
||||
size_t len = strnlen(arg, STR_MAX_LEN);
|
||||
|
||||
if (len > STR_MAX_LEN)
|
||||
if (len == STR_MAX_LEN)
|
||||
return -1;
|
||||
|
||||
if (SOCK_PATH_OPT == getsubopt(&arg, token, &value)) {
|
||||
|
||||
Reference in New Issue
Block a user