Received: from eggs.gnu.org ([2001:4830:134:3::10]:48857) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEG8M-0002R0-T5 for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:41:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEG8J-0000Rb-Nz for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:41:10 -0500 Received: from mail-wg0-x22b.google.com ([2a00:1450:400c:c00::22b]:51963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEG8J-0000RF-HA for qemu-devel@nongnu.org; Thu, 22 Jan 2015 06:41:07 -0500 Received: by mail-wg0-f43.google.com with SMTP id y19so1222548wgg.2 for ; Thu, 22 Jan 2015 03:41:06 -0800 (PST) Date: Thu, 22 Jan 2015 11:41:04 +0000 From: Stefan Hajnoczi Message-ID: <20150122114104.GE28491@stefanha-thinkpad.redhat.com> References: <943d55a006aab912af62bbb89833a48baba2d69c.1421768887.git.jcody@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="u5E4XgoOPWr4PD9E" Content-Disposition: inline In-Reply-To: <943d55a006aab912af62bbb89833a48baba2d69c.1421768887.git.jcody@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 5/6] block: mirror - change string allocation to 2-bytes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, jsnow@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com --u5E4XgoOPWr4PD9E Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 20, 2015 at 12:31:32PM -0500, Jeff Cody wrote: > The backing_filename string in mirror_run() is only used to check > for a NULL string, so we don't need to allocate 1024 bytes (or, later, > PATH_MAX bytes), when we only need to copy the first 2 characters. >=20 > We technically only need 1 byte, as we are just checking for NULL, but > since backing_filename[] is populated by bdrv_get_backing_filename(), a > string size of 1 will always only return '\0'; >=20 > Signed-off-by: Jeff Cody > --- > block/mirror.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Stefan Hajnoczi --u5E4XgoOPWr4PD9E Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUwOHPAAoJEJykq7OBq3PIdL4H/06/T8oQVEE7UvHRbMlJm+Hl +ZQ3GF465/QKBCgOePyBfUgQqYlGfOFPKJTuvAdsYoXNrdiKZ9cy5wrjhrIz51/j 92SO7Qzl4ujIPYlLapdc8Ry26W3+eeLQm4XsisD5wPC4PXM3RueR5Vic+LYPo8PZ KJau2GAM5c70tqeBraQeXMwLj5zIf+PYYyZHm93J5IZId+XYpXk6574NHtir7QqD kmL2IczRtmWO67fekt7+vy14FavRGWawA/LbmAKF6ASbQidQBXMhqIxaGXcc6o6n k8iWf/ifGZf3EnVJlgR6b75mqEcw/QL5goeqvF8Po2emcs1aFemqx3aP4Z5VhrM= =TT9I -----END PGP SIGNATURE----- --u5E4XgoOPWr4PD9E--