On Wed, Mar 02, 2016 at 03:11:27PM +0100, Paolo Bonzini wrote:
> 
> 
> On 29/02/2016 21:08, Jeff Cody wrote:
> > From: Vasiliy Tolstov <v.tols...@selfip.ru>
> > 
> > This patch implements a blockdriver function bdrv_snapshot_delete() in
> > the sheepdog driver. With the new function, snapshots of sheepdog can
> > be deleted from libvirt.
> > 
> > Cc: Jeff Cody <jc...@redhat.com>
> > Signed-off-by: Hitoshi Mitake <mitake.hito...@lab.ntt.co.jp>
> > Signed-off-by: Vasiliy Tolstov <v.tols...@selfip.ru>
> > Message-id: 1450873346-22334-1-git-send-email-mitake.hito...@lab.ntt.co.jp
> > Signed-off-by: Jeff Cody <jc...@redhat.com>
> > ---
> >  block/sheepdog.c | 125 
> > ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 123 insertions(+), 2 deletions(-)

[...]

 > +    memset(buf, 0, sizeof(buf));
> > +    memset(snap_tag, 0, sizeof(snap_tag));
> > +    pstrcpy(buf, SD_MAX_VDI_LEN, s->name);
> > +    if (qemu_strtoul(snapshot_id, NULL, 10, (unsigned long *)&snap_id)) {
> 
> This cast seems like a very bad idea, and in fact it is.  qemu_strtoul
> will access 8 bytes on 64-bit machines.  Please change snap_id to be an
> unsigned long instead.
>

Thanks Paolo, I missed that.  I just sent a patch to fix this.

-Jeff

Reply via email to