From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ab9Oj-0006UT-9j for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:13:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ab9Oe-0002h9-77 for qemu-devel@nongnu.org; Wed, 02 Mar 2016 11:13:13 -0500 Date: Wed, 2 Mar 2016 11:12:54 -0500 From: Jeff Cody Message-ID: <20160302161254.GG26318@localhost.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v2 1/1] block/sheepdog: fix argument passed to qemu_strtoul() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: kwolf@redhat.com, mitake.hitoshi@lab.ntt.co.jp, qemu-devel@nongnu.org, v.tolstov@selfip.ru, mreitz@redhat.com, pbonzini@redhat.com, namei.unix@gmail.com On Wed, Mar 02, 2016 at 11:09:29AM -0500, Jeff Cody wrote: > The function qemu_strtoul() reads 'unsigned long' sized data, > which is larger than uint32_t on 64-bit machines. > > Even though the snap_id field in the header is 32-bits, we must > accomodate the full size in qemu_strtoul(). > > This patch also adds more meaningful error handling to the > qemu_strtoul() call, and subsequent results. > > Reported-by: Paolo Bonzini > Signed-off-by: Jeff Cody > --- > block/sheepdog.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > Ideally, one of the other Sheepdog maintainers (Hitoshi Mitake or Liu Yuan) could run a test against this patch, as I don't have an easy way of testing it. Thanks, Jeff