From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gP9Kv-0005BP-T3 for qemu-devel@nongnu.org; Tue, 20 Nov 2018 11:57:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gP9Kv-00040G-7v for qemu-devel@nongnu.org; Tue, 20 Nov 2018 11:57:17 -0500 References: <20181120152753.10463-1-marcandre.lureau@redhat.com> <20181120152753.10463-2-marcandre.lureau@redhat.com> From: Eric Blake Message-ID: <962f0417-913f-ce5a-0b7f-aeda51c16900@redhat.com> Date: Tue, 20 Nov 2018 10:56:59 -0600 MIME-Version: 1.0 In-Reply-To: <20181120152753.10463-2-marcandre.lureau@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-3.1? 1/3] sheepdog: fix stringop-truncation warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu-devel@nongnu.org Cc: Kevin Wolf , qemu-block@nongnu.org, Juan Quintela , Jeff Cody , "Michael S. Tsirkin" , "Dr. David Alan Gilbert" , Max Reitz , Igor Mammedov , Liu Yuan On 11/20/18 9:27 AM, Marc-Andr=C3=A9 Lureau wrote: > It seems adding an assert is enough to silence GCC. > (sd_parse_snapid_or_tag() g_strlcpy() ensures that we don't get in > that situation) >=20 > ~/src/qemu/block/sheepdog.c: In function 'find_vdi_name': > ~/src/qemu/block/sheepdog.c:1239:5: error: 'strncpy' specified bound 25= 6 equals destination size [-Werror=3Dstringop-truncation] > strncpy(buf + SD_MAX_VDI_LEN, tag, SD_MAX_VDI_TAG_LEN); > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > cc1: all warnings being treated as errors >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau > --- > block/sheepdog.c | 1 + > 1 file changed, 1 insertion(+) Reviewed-by: Eric Blake and safe for 3.1 in my opinion --=20 Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org