2018-12-27 17:53:01 +08:00
|
|
|
|
From a86a6e327887c28457391ae0a8cb0e8aefa24d6f Mon Sep 17 00:00:00 2001
|
2018-10-11 02:06:46 +08:00
|
|
|
|
From: Shuo Liu <shuo.a.liu@intel.com>
|
|
|
|
|
Date: Fri, 31 Aug 2018 10:59:02 +0800
|
2018-12-27 17:53:01 +08:00
|
|
|
|
Subject: [PATCH 078/214] vhm: use correct string length
|
2018-10-11 02:06:46 +08:00
|
|
|
|
MIME-Version: 1.0
|
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
|
|
Fix below compile warning:
|
|
|
|
|
drivers/vhm/vhm_ioreq.c:207:3: warning: ‘strncpy’ specified bound 16
|
|
|
|
|
equals destination size [-Wstringop-truncation]
|
|
|
|
|
strncpy(client->name, name, sizeof(client->name));
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
|
|
|
|
|
Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
|
|
|
|
|
---
|
|
|
|
|
drivers/vhm/vhm_ioreq.c | 2 +-
|
|
|
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/drivers/vhm/vhm_ioreq.c b/drivers/vhm/vhm_ioreq.c
|
|
|
|
|
index c91a60598114..5cb15b5badd8 100644
|
|
|
|
|
--- a/drivers/vhm/vhm_ioreq.c
|
|
|
|
|
+++ b/drivers/vhm/vhm_ioreq.c
|
|
|
|
|
@@ -204,7 +204,7 @@ int acrn_ioreq_create_client(unsigned long vmid, ioreq_handler_t handler,
|
|
|
|
|
|
|
|
|
|
client->vmid = vmid;
|
|
|
|
|
if (name)
|
|
|
|
|
- strncpy(client->name, name, 16);
|
|
|
|
|
+ strncpy(client->name, name, sizeof(client->name) - 1);
|
|
|
|
|
spin_lock_init(&client->range_lock);
|
|
|
|
|
INIT_LIST_HEAD(&client->range_list);
|
|
|
|
|
init_waitqueue_head(&client->wq);
|
|
|
|
|
--
|
2018-12-27 17:53:01 +08:00
|
|
|
|
2.19.1
|
2018-10-11 02:06:46 +08:00
|
|
|
|
|