]> git.droids-corp.org - dpdk.git/blobdiff - examples/vhost_scsi/scsi.c
examples/vhost_scsi: fix product id string termination
[dpdk.git] / examples / vhost_scsi / scsi.c
index 54d3104ed5045a2daf98d4acd78e49ac6014b82b..fd430ec23bf5d690e44231b92b5c9b98b18241ef 100644 (file)
@@ -307,7 +307,9 @@ vhost_bdev_scsi_inquiry_command(struct vhost_block_dev *bdev,
                strncpy((char *)inqdata->t10_vendor_id, "INTEL", 8);
 
                /* PRODUCT IDENTIFICATION */
-               strncpy((char *)inqdata->product_id, bdev->product_name, 16);
+               snprintf((char *)inqdata->product_id,
+                               RTE_DIM(inqdata->product_id), "%s",
+                               bdev->product_name);
 
                /* PRODUCT REVISION LEVEL */
                strncpy((char *)inqdata->product_rev, "0001", 4);