From: Ian Jackson Subject: Re: [PATCH] tapdisk2: initialize 'name' parameter of BLKTAP2_IOCTL_CREATE_DEVICE Date: Wed, 14 Mar 2012 10:12:02 +0000 Message-ID: <20320.28402.999896.395562@mariner.uk.xensource.com> References: <4F5A30510200007800077640@nat28.tlf.novell.com> <20319.28003.410977.742962@mariner.uk.xensource.com> <4F6057B2020000780007830A@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4F6057B2020000780007830A@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 ("Re: [Xen-devel] [PATCH] tapdisk2: initialize 'name' parameter of BLKTAP2_IOCTL_CREATE_DEVICE"): > > | Warning: If there is no null byte among the first n bytes > > | of src, the string placed in dest will not be null-terminated. > > That's actually expected here - the kernel code needs to be careful > about no trailing NUL anyway. Oh, OK. > > An easy fix would be to memset params to 0 first. > > That would not help at all - if src is longer than available space, then > there still wouldn't be a NUL in the end. On would additionally have to > subtract 1 from the size argument. But as said, all that is unnecessary. Yes, I realised that suggestion of mine was confused. Ian.