hbitmap: add assertion on hbitmap_iter_init
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Jan 2013 14:01:12 +0000 (15:01 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 25 Jan 2013 17:18:35 +0000 (18:18 +0100)
commit1b0952445522af73b0e78420a9078b3653923703
treeb736c93c1884f518c567d4ff3bd7dc9199ec4948
parent88ff0e48eedd679a9dc1122676d8aa29f8d07571
hbitmap: add assertion on hbitmap_iter_init

hbitmap_iter_init causes an out-of-bounds access when the "first"
argument is or greater than or equal to the size of the bitmap.
Forbid this with an assertion, and remove the failing testcase.

Reported-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
include/qemu/hbitmap.h
tests/test-hbitmap.c
util/hbitmap.c