]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vbox: Avoid signed and unsigned comparison
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Feb 2016 08:27:34 +0000 (09:27 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 23 Feb 2016 14:38:20 +0000 (15:38 +0100)
commita0e5faaf66a185966ea8656799ead4703675a233
tree797f43764d7a457022438556bb9c814acb70cba5
parent0f396a41595edd9107e1ffcb7c6bf49316bcc90b
vbox: Avoid signed and unsigned comparison

After 457ff97fa there are two defects in our code. In both of
them we use a signed variable to hold up a number of snapshots
that domain has. We use a helper function to count the number.
However, the helper function may fail in which case it returns
a negative one and control jumps to cleanup label where an
unsigned variable is used to iterate over array of snapshots. The
loop condition thus compare signed and unsigned variables which
in this specific case ends up badly for us.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/vbox/vbox_common.c