On Fri, Sep 18, 2020 at 04:09:10PM +0800, Coiby Xu wrote:
> +    case VIRTIO_BLK_T_GET_ID: {
> +        size_t size = MIN(iov_size(&elem->in_sg[0], in_num),
> +                          VIRTIO_BLK_ID_BYTES);
> +        snprintf(elem->in_sg[0].iov_base, size, "%s", 
> "vhost_user_blk_server");

gcc (GCC) 10.2.1 says:

../block/export/vhost-user-blk-server.c:178:50: error: ā€˜%sā€™ directive output 
truncated writing 21 bytes into a region of size 20 [-Werror=format-truncation=]
  178 |         snprintf(elem->in_sg[0].iov_base, size, "%s", 
"vhost_user_blk_server");
      |                                                  ^~   
~~~~~~~~~~~~~~~~~~~~~~~

I suggest changing this string constant to "vhost_user_blk" for now.

Attachment: signature.asc
Description: PGP signature

Reply via email to