mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-17 14:58:43 +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:
@@ -59,6 +59,7 @@ enum {
|
||||
UMSTR_MAX
|
||||
};
|
||||
|
||||
#define UMOUSE_DESC_MAX_LEN 32
|
||||
static const char *const umouse_desc_strings[] = {
|
||||
"\x04\x09",
|
||||
"ACRN-DM",
|
||||
@@ -437,7 +438,7 @@ umouse_request(void *scarg, struct usb_data_xfer *xfer)
|
||||
goto done;
|
||||
}
|
||||
|
||||
slen = 2 + strlen(str) * 2;
|
||||
slen = 2 + strnlen(str, UMOUSE_DESC_MAX_LEN) * 2;
|
||||
udata[0] = slen;
|
||||
udata[1] = UDESC_STRING;
|
||||
|
||||
|
Reference in New Issue
Block a user