]> git.ipfire.org Git - thirdparty/qemu.git/commit
hbitmap: handle set/reset with zero length
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Fri, 11 Oct 2019 09:07:07 +0000 (12:07 +0300)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 4 Nov 2019 14:31:55 +0000 (08:31 -0600)
commitc0b35d87de345bd3b59a44c604b247a0497f2fc0
tree37581ead5dcac2e1732933bb458ace1654a16149
parentfcd7cba6acb7344aca70f5f8ec16626e817b35a5
hbitmap: handle set/reset with zero length

Passing zero length to these functions leads to unpredicted results.
Zero-length set/reset may occur in active-mirror, on zero-length write
(which is unlikely, but not guaranteed to never happen).

Let's just do nothing on zero-length request.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-id: 20191011090711.19940-2-vsementsov@virtuozzo.com
Reviewed-by: Max Reitz <mreitz@redhat.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit fed33bd175f663cc8c13f8a490a4f35a19756cfe)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
util/hbitmap.c