mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
dm: use strncpy to replace strcpy
Use strncpy instead of strcpy to avoid buf overflow. Fix strncpy null-terminated issues. Tracked-On: #3245 Signed-off-by: Tianhua Sun <tianhuax.s.sun@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -116,6 +116,7 @@ virtio_hyper_dmabuf_k_dev_set(const char *name, int vmid, int nvq,
|
||||
{
|
||||
/* init kdev */
|
||||
strncpy(kdev.name, name, VBS_NAME_LEN);
|
||||
kdev.name[VBS_NAME_LEN - 1] = '\0';
|
||||
kdev.vmid = vmid;
|
||||
kdev.nvq = nvq;
|
||||
kdev.negotiated_features = feature;
|
||||
|
||||
Reference in New Issue
Block a user