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 <[email protected]>
> > 
> > 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 <[email protected]>
> > Signed-off-by: Hitoshi Mitake <[email protected]>
> > Signed-off-by: Vasiliy Tolstov <[email protected]>
> > Message-id: [email protected]
> > Signed-off-by: Jeff Cody <[email protected]>
> > ---
> >  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