mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +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:
@@ -217,7 +217,7 @@ static int ctrl_chan_conn(const char *servername)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (strlen(servername) > (sizeof(servaddr.sun_path) -1)) {
|
||||
if (strnlen(servername, sizeof(servaddr.sun_path)) == (sizeof(servaddr.sun_path))) {
|
||||
printf("%s error, length of servername is too long\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user