From: Ian Jackson Subject: Re: [PATCH] tapdisk2: initialize 'name' parameter of BLKTAP2_IOCTL_CREATE_DEVICE Date: Tue, 13 Mar 2012 15:53:07 +0000 Message-ID: <20319.28003.410977.742962@mariner.uk.xensource.com> References: <4F5A30510200007800077640@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F5A30510200007800077640@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel List-Id: xen-devel@lists.xenproject.org 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.