[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tapdisk2: initialize 'name' parameter of BLKTAP2_IOCTL_CREATE_DEVICE



Jan Beulich writes ("[Xen-devel] [PATCH] tapdisk2: initialize 'name' parameter 
of BLKTAP2_IOCTL_CREATE_DEVICE"):
> This keeps the kernel driver from printing garbage.
...
> +     strncpy(params.name, vbd->name, BLKTAP2_MAX_MESSAGE_LEN);

I don't think this is right.  As the FM for strncpy puts it:

 |        Warning: If there is no null byte among the first n bytes
 | of src, the string placed in dest will not be null-terminated.

An easy fix would be to memset params to 0 first.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.